How to Register a DLL or OCX Files in Windows
Sometimes the applications may miss registering the DLL or OCX files, due to which users will face errors and applications won’t work properly. Because of this, users will require to register the files by themselves. The registering and unregistering of the application extension files (DLL or OCX) are done by RegSvr32 utility. In this article, we will teach you how easily you can register a DLL or OCX file in your operating system.
Registering a DLL or OCX File in Windows
By registering a DLL or OCX, users are adding the information to the registry so that Windows can use those files. The information will be in the form of a name or CLSID. This makes it easier for Windows to find the correct DLL or OCX when a function related to it is used within another program. It will contain the path of these files through which the executable code for the component will be used. The information saved in the registry will always refer to the latest version of the component. This is required only in rare cases because in most cases the applications will register these files during installation. It can also be used for the repairing of the Windows issues that include these files. Some extra parameters that you can add to the commands:
- /u – Unregister the DLL or OCX file
- /s – Silent mode, it will show no message boxes.
- /I – If used without /u then calls DLLInstall(TRUE) to install and If used with /u then calls DllInstall(FALSE) to uninstall the DLL and DllUnregisterServer.
- /n – For not calling the DllRegister Server or DllUnregisterServer. This option must be used with /i.
You can only register the DLL or OCX files that are registerable. Some files will have no DLLRegisterServer() functions through which it can register. Those files are ordinary and have nothing to do with registering. An example can be taken from game DLL files that stay in the folder and do their job without getting registered in the first place.
Note: Make sure you already have the DLL or OCX file available before trying these methods.
Using the Elevated Command Prompt to Register a DLL or OCX File
- Hold the Windows key and press S to open the search function. Type cmd, right-click on it and choose Run as administrator option
Note: You can also press Alt + Shift + Enter after typing cmd in the search function. - Now type the command below to register the DLL or OCX file.
regsvr32 jscript.dll
Note: jscript.dll is the file name that you can change to whatever file you want to register.
- You can also register a DLL or OCX file that is located in a different location by typing the following command.
regsvr32 C:\Users\Kevin\Desktop\jscript.dll
- If the file is not registerable then you may get the error as shown below:
- Sometimes the error can be because you are trying to register a 32-bit DLL or OCX file through 64-bit Regsvr32. You need to use the 32-bit Regsvr32 that is located in the Syswow64 folder.
- You can type the following command to register 32-bit DLL or OCX in a 64-bit operating system.
%SystemRoot%\SysWOW64\regsvr32 jscript.dll
You can also use PowerShell with the same commands to register DLL or OCX files.