How to use batch files to realize batch registration of dll
This article mainly shows you "how to use batch files to achieve batch registration dll", the content is easy to understand, clear, hope to help you solve your doubts, the following let Xiaobian lead you to study and learn "how to use batch files to achieve batch registration dll" this article.
But for beginners, even if they know that the DLL file is damaged, there is nothing they can do about it, so you can register the DLL file in a loop with this batch process to solve all kinds of failures due to the loss of DLL!
The following is a list of all the dll in the registered system32 directory
The code is as follows:
For% I in (% windir%\ system32\ * .dll) do regsvr32.exe / s% I
If you want to customize the directory, you can change it to this.
The code is as follows:
For% I in (directory of DLL files you want to register\ * .dll) Do regsvr32.exe / s% I For% I in (DLL text you want to register
Item directory\ * .ocx) Do regsvr32.exe / s% I
Here is a single way to register a dll file (take w32time.dll as an example)
The code is as follows:
@ echo starts to register
Copy w32time.dll% windir%\ system32\
Regsvr32% windir%\ system32\ w32time.dll / s
@ echo registered successfully
@ pause
Just replace w32time.dll when using it.
The following is the code for single or multiple batch registrations, which you can modify.
1) Registration
Regist.bat
The code is as follows:
@ echo starts to register
Net stop iisadmin / y
@ echo jumps to the current batch file path
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 registered successfully
@ pause
2) re-registration
ReRegist.bat
The code is as follows:
@ echo re-register
Net stop iisadmin / y
@ echo jumps to the current batch file path
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 re-registered successfully
@ pause
3) Anti-registration
UnRegist.bat
The code is as follows:
@ echo Delete Registration
Net stop iisadmin / y
@ echo jumps to the current batch file path
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 deleted registration successfully
@ pause
The above is all the contents of the article "how to use batch files to achieve batch registration of dll". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!