有时候用电脑的时候遇到由于DLL文件丢失或损坏而造成的种种故障,大家都只知道只要重新注册一下DLL文件就可以了,但是对于新手来说即使知道是DLL文件损外,但是不知道是哪个DLL文件也束手无策,所以用这个批处理可以循环注册DLL文件,达到解决由于DLL丢失的种种故障!
for %%i in (%windir%/system32/*.dll) do regsvr32.exe /s %%i
下面是单个注册dll文件的方法(这里以w32time.dll为例)
@echo 开始注册
copy w32time.dll %windir%/system32/
regsvr32 %windir%/system32/w32time.dll /s
@echo 注册成功
@pause
使用的时候替换掉w32time.dll即可
1)注册
Regist.bat
@echo 开始注册
net stop iisadmin /y
@echo 跳转到当前批处理文件路径
cd %~dp0
copy DynamicGif.dll %windir%/system32
regsvr32 %windir%/system32/DynamicGif.dll /s
copy ImageOle.dll %windir%/system32
regsvr32 %windir%/system32/ImageOle.dll /s
net start w3svc
@echo 注册成功
@pause
2)重新注册
ReRegist.bat
@echo 重新注册
net stop iisadmin /y
@echo 跳转到当前批处理文件路径
cd %~dp0
regsvr32/u %windir%/system32/DynamicGif.dll /s
del %windir%/system32/DynamicGif.dll
copy DynamicGif.dll %windir%/system32
regsvr32 %windir%/system32/DynamicGif.dll /s
regsvr32/u %windir%/system32/ImageOle.dll /s
del %windir%/system32/ImageOle.dll
copy ImageOle.dll %windir%/system32
regsvr32 %windir%/system32/ImageOle.dll /s
net start w3svc
@echo 重新注册成功
@pause
3)反注册
UnRegist.bat
@echo 删除注册
net stop iisadmin /y
@echo 跳转到当前批处理文件路径
cd %~dp0
regsvr32/u %windir%/system32/DynamicGif.dll /s
del %windir%/system32/DynamicGif.dll
regsvr32/u %windir%/system32/ImageOle.dll /s
del %windir%/system32/ImageOle.dll
net start w3svc
@echo 删除注册成功
@pause