Register DLLs and OCX files in Windows Vista (REGSVR32)

If you are also facing same problem as I have been facing while trying to register custom DLL files in Vista as whenever I issued following command –

REGSVR32 C:\xxx.dll?

I have a turn around for that. I received error regarding User Access Control.

Even when you try to run any executable file in Vista, every time it asks you to confirm if you want to run that program or not as if it doesn’t believe that you are the one who tried to open that program.

 

Vista User Account Control

 

If you think that you can manage it enough by yourself, you can go for disabling this prompt as I did. For that you will need to go to Control Panel > User Accounts and Family Safety > User Accounts and there click Turn User Account Control on or off. Unselect Use User Account Control (UAC) to help protect your computer option and click OK. That’s it. Now try to register your DLLs and you would be able to do that without any hiccups.

 

Also there is shortcut method to do that from command line –

Disable UAC:

C:\Windows\System32\cmd.exe /k %windir%\System32\reg.exe
ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f

 

Enable UAC:

C:\Windows\System32\cmd.exe /k %windir%\System32\reg.exe
ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 1 /f

 

Reboot your system and you are done.

 

And if you are getting this error while registering your DLLs –

The module REGSVR32 “C:\Program Files\xxx.dll? failed to load.

Make sure the binary is stored at the specified path or debug it to check for problems with the binary or dependent .DLL files.

The specified module couldn’t be found.

.

(I don’t know why that extra dot in the end – may be UI bug from Vista team!) 

 

It means you are not giving proper path. Try to correct the path for your DLL and you will be able to register it.