Sunday, August 8, 2010

Windows 7 - Register comdlg32.ocx

I wrote a VB6 program a long time ago, and I wanted it to run in Window7. The problem I encountered was that the file 'comdlg32.ocx' which normally accompanies the .exe file for VB6 apps wouldn't run in Windows7.

I have administrator privileges for my usual log in so I attempted to change privileges for the .OCX file, but it still wouldn't work. A error message was produced with a cryptic code. The problem turned out to be the need for the .OCX file to be registered.

The registration is committed by the command line prompt:

regsvr32 comdlg32.exe

Unfortunately, this was not successful and Windows 7 complained.

Equally unfortunate were our attempts to us the 'runas' command.
runas \user:administrator "regsvr32 comdlg32.exe" produced prompts for passwords we didn't know.

You see, the administrator account and password is hidden in Window7.

The work around was to log in to the command prompt as administrator (see previous article), then run the simplified version of the command "regsvr32 comdlg32.exe".

Thanks to Russell for his help - without which I would still be flannelling around.

Windows 7 - Running a Command as Administrator

Well, this one had multiple geek brains tricked for a short while, but we prevailed...

Click the sequence Windows (orb at the bottom left) > All Programs > Accessories

Right click Command Prompt

Click Run As Administrator

Respond to any security prompt.

You may now run a command line as administrator, e.g. regsvr32. (See next entry)


Click Open >