批处理文件(bat文件)注册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

你可能感兴趣的:(批处理文件(bat文件)注册dll)