Copying DLL and OCX files to System32 and SysWOW64 folders and registering them
@ECHO OFF
cd /d %~dp0
for %%i in ("C:\Windows\System32","C:\Windows\SysWOW64") do copy /Y /V "dmimage_alt.dll" "%%i\"
for %%i in ("C:\Windows\System32","C:\Windows\SysWOW64") do copy /Y /V "OBXAltViewer.ocx" "%%i\"
for %%i in ("C:\Windows\System32","C:\Windows\SysWOW64") do copy /Y /V "OBXAltViewer.inf" "%%i\"
for /f %%i in ("C:\Windows\System32\dmimage_alt.dll","C:\Windows\SysWOW64\dmimage_alt.dll") do regsvr32 /s %%i
for /f %%i in ("C:\Windows\System32\OBXAltViewer.ocx","C:\Windows\SysWOW64\OBXAltViewer.ocx") do regsvr32 /s %%i
This is a great community, with a lot of immensely smart and helpful people.
Thanks in advance for any insight into my issue here, and for any pointers in the right direction!
Answers (3)
AFAIK there are two version of regsvr32, a 32bit version and a 64bit version. If you start the command prompt / batch file in a 32bit process, it should use the correct one (32bit).
I must also ask, why are you copying them to both the 64bit AND 32bit file system. If they are 32bit then just copying them to the 32bit file system should suffice (SysWOW64), and using the 32bit regsvr32 to register them...
Cheers
Phil
Thanks for the response, Phil. But this is for many PCs which include both 32 and 64 bit machines. I'm more concerned about getting these files to show up in the appropriate system directories(depending on whether it is a 32 or 64 bit machine), than registering them. Since the first part itself isn't working as it should, I didn't expect the registration part to function anyway. Attached is a screenshot of the second iteration of this script where it is told to unzip the zipped DLL folder into the System32/SysWOW64 folders, and then "Run a batch file..." that I created within KACE itself and appears as another dependency[with a KACE-assigned name].
Thanks again for your question.
Comments:
-
Hi,
then just write your batch file as if it was running on a 32bit system (%windir%\system32) and ensure that the batch file is called ina 32bit context. Then you don't need to worry about the bitness of the system as the OS will sort that out for you (re-direction) - Pressanykey 7 years ago
Comments:
-
Hi Ian, fair one regarding OCX's, but metaphorically I meant ActiveX / COM in general. As is, the alternative "registry free" is still too complex for none .Net resources so I expect that we will still be dealing with this for many years to come... (I've heard some people stating that COM is dead... I just ask myself if they have ever had a look at the DirectX / WinRT API's....)
Cheers
Phil - Pressanykey 7 years ago