Register Dynamic Link Library

Source: Internet
Author: User

All DLL files are generally in the System32 directory. Registering all DLL files under the System32 directory can solve most problems caused by DLL files. in the implementation process, run the following command:
For % 1 in (% WINDIR %/system32/*. dll) Do regsvr32.exe/S % 1
"Command Prompt" and enter the command, which is the command prompt under the MS-DOS. It does not mean running directly.
Note the space position. There is no space in the brackets, and the rest is followed by a space.

Create a text file and type the following two lines to save it as a [Register and fix DLL. Bat] batch file.
For % 1 in (% WINDIR %/system32/*. dll) Do regsvr32.exe/S % 1
For % 1 in (% WINDIR %/system32/*. ocx) Do regsvr32.exe/S % 1

 Background and functions of regsvr32

Regsvr32 is an embedded program in windows. It exists not only in Windows 2000/XP, but also in Windows 98. Its main function is to register or uninstall dynamic link library files (DLL) and embedded controls (OCX). Do not underestimate it. With it, A lot of software or operating system problems can be solved.

DLL file: The full name of the DLL file is dynamic link library. The Chinese name is "Dynamic Link Library File ". In Windows, a DLL file can complete a function just like an EXE file, but it cannot run as independently as an EXE file. It must be called by other programs, it is also very important for program execution. Most programs or system components must be linked to DLL files during execution to run normally. In other words, the DLL file is like a common function library in the database. Every designer can call them in their own program. In this way, not only do you not need to write some basic functions (because these functions have been completed by DLL files), but also make the program smaller. Therefore, if a DLL file is lost, a software or system module may fail and cannot work properly.

Ocx file: The full name of ocx file is Object Linking and Embedding (OLE) control extension. The Chinese name is "embedded object control". Its role is actually very similar to the DLL file just mentioned, in fact, we are already very familiar with the so-called Ole. Simply put, it is like using Excel Data in word, and embedding image files in wordboards. For example, the clipboard is like a simple data sharing, while Ole is an "Object sharing ".

The regsvr32 function registers and uninstalls DLL files. The DLL file serves as a public function library. Why can't it be called directly in a program or a registration? If the DLL file is not registered, the system registry does not have the relevant information about the DLL file. Although it already exists on our hard disk, when it is called, the system cannot find this DLL file and can only report that this DLL does not exist. Therefore, we need to register the DLL file at this time.

[Tips] Windows system DLL does not need to be registered because it has been registered during installation. However, if the system cannot identify these DLL files, we still need to manually register it again.

Regsvr32 Command Format

Regsvr32 command.

Regsvr32 command format. Take Windows XP as an example. In the "Start" menu> "run" column, run the "cmd" command, open the command prompt line window, enter the regsvr32 command, and press Enter, the Command Format "regsvr32 [/u] [/S] [/n] [/I [: using line] DLL file name" is displayed ".

 

 

The preceding figure shows that the regsvr32 command has four parameters:

/S: A prompt box Indicating successful operation is not displayed after registration or uninstallation is successful

/U: uninstall installed controls or DLL files

/N: Do not call dllregisterserver. Note that this parameter should be used with/I.

/I: Call dllinstall and pass it an optional [offline line]. It is used to uninstall the DLL when/u is used.

The instance understands the Command Format of regsvr32. For example, we want to register a shmedia file stored in the C:/folder directory. DLL dynamic link library file, the command to be executed should be "regsvr32 C:/folder/shmedia. DLL, and if it is easier to uninstall after registration, execute the command "regsvr32/u c:/folder/shmedia. DLL.

Common error messages

Error message using regsvr32 command.

Error 1: the path of the DLL file is not specified.

 

This type of error is common. Generally, when registering a non-system DLL file, the reason is that the regsvr32 program cannot find the specified DLL file in the default path and cannot complete the registration normally. The solution is also very simple. You only need to specify the specific storage path of the DLL file in the command. For example, "regsvr32 C:/folder/ABC. dll" is a normal command.

Error 2: the file type to be registered is incorrect.
This error is rare because the file to be registered is not a normal DLL file or ocx file, and regsvr32 cannot complete the registration. The solution is to specify a normal DLL file or ocx file. For example, if the original command is "regsvr32 C:/ABC/abc.txt", the correct command should be "regsvr32 C:/ABC. dll

Error 3: The DLL file name is not specified in the command.

 

The reason is that the DLL file name is not specified at all, so regsvr32 naturally cannot know what to perform, so this prompt will pop up. The solution is to specify the DLL file or ocx file to be operated.

Instance

Common instances.

You may know that the ZIP folder (compressed folder) can be displayed by default in Windows XP, but the problem is that the third-party decompression software WinRAR or WinZip is generally used, in this way, the default display function of the ZIP folder in XP becomes a decoration, which wastes a lot of system resources.

Run the regsvr32 command to uninstall it.

Enter the Command Prompt window and run regsvr32/u zipfldr. dll. Of course, if you want to enable regsvr32 zipfldr. dll again after uninstallation, you just need to execute the regsvr32 zipfldr. dll command again.

Example 2: uninstall the Windows Image preview function

The image preview function is similar to the ZIP file display function mentioned above ,.

Enter the Command Prompt window and execute the command: regsvr32/u shimgvw. dll. Of course, the method for re-enabling is the same as that for regsvr32 shimgvw. dll.

Example 3: repair damaged IE browser

The IE link clicking is invalid and the new window cannot be opened normally. Basically, reinstalling IE will solve the problem. However, this method requires both time and effort and directly uses the regsvr32 command.

Enter the Command Prompt window and run regsvr32 actxprxy. DLL. After the normal report window pops up, run the command regsvr32 shdocvw again. DLL, and then wait for the normal report to pop up, continue to execute the command: regsvr32 oleaut32.dll, after the last normal report pops up, you can re-open IE to try.

Example 4: uninstall XP's image preview function is also very simple

Like the image preview function mentioned above, the image preview function of XP (that is, the video file preview function) can also be registered and uninstalled.

Enter the Command Prompt window and run regsvr32/u shmedia. dll can successfully uninstall XP's default image preview function, of course, remove the/u parameter, that is, regsvr32 shmedia. the DLL command can re-register the image preview function.

[Tips] All the above instances have reversed these system functions so that the system cannot use these functions and has not deleted any system files, therefore, you can easily re-register these functions, and the entire process is reversible.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.