This one's pretty simple so I won't go into too much detail about it. The script makes use of the regsvr32 command to do it's work, as usual:
- Copy the code into a text file
- Ensure that the paths are correct
- Save the file with the .bat extension
- Run the file as administrator to ensure that there are no permissions issues
so here's the code, firstly it will unregister the given .dll and then register the second, if you want to re-register then these two paths will be the same:
regsvr32 /u "C:\Windows\System32\myfile.dll" regsvr32 "C:\Windows\System32\myfile.dll"