I need to release some very old software to work with Windows 7 (X86 and X64). My only compatibility issue is the registration of 4 .ocx files. I have written the following batch file to register based on system architecture.
@echo off
setlocal enableextensions
set REGSVR=
if defined PROCESSOR_ARCHITEW6432 (
set REGSVR=%SystemRoot%\system32\regsvr32.exe
) else (
set REGSVR=%SystemRoot%\SysWOW64\regsvr32.exe
)
if defined PROCESSOR_ARCHITEW6432 (
%REGSVR% /s "C:\Windows\System32\mswinsck.ocx"
%REGSVR% /s "C:\Windows\System32\Timgctrlv6.ocx"
%REGSVR% /s "C:\Windows\System32\Graphic.ocx"
%REGSVR% /s "C:\Windows\System32\mscomctl.ocx"
) else (
%REGSVR% /s "c:\windows\sysWOW64\mswinsck.ocx"
%REGSVR% /s "c:\windows\sysWOW64\Timgctrlv6.ocx"
%REGSVR% /s "c:\windows\sysWOW64\Graphic.ocx"
%REGSVR% /s "c:\windows\sysWOW64\mscomctl.ocx"
)
This works beautifully in 64 bit Windows 7 by running the batch file as admin. However in my 32 bit Windows 7 test environment it requires me to first disable the UAC prior to running the batch file or it has no affect (even if I right-click and "Run as Admin"). Can someone shed light on how this could be, or possibly how to do this so that I do not have to stipulate to our customers to disable UAC "only for Win 7 32 bit"?