Use regsvr32 to solve system problems

Source: Internet
Author: User

First glance at regsvr32

Certainly, regsvr32 is no stranger to everyone. It can always be seen in some computer tutorials or computer magazines, but such a high appearance rate "Little Star" is very mysterious in the eyes of many of us.ArticleIt is rarely introduced. At most, I just want to explain how to use it to solve common problems. Many of my friends may have used regsvr32 many times under the guidance of some articles, however, I still don't know about it. Today, I will use this article to dispel the doubts in my mind and take you to get to know this regsvr32.

Background and functions of regsvr32

Regsvr32 is an embedded Windows SystemProgramNot only does it exist in Windows 2000/XP, but it is found in coin processing indows 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.

Basics

When we talked about DLL and OCX just now, it is estimated that such a problem will occur in the hearts of many readers. What do these two things mean? What exactly can they do? Don't worry. Let me hear you come here.

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 ".

Just now we talked about regsvr32's function of registering and detaching DLL files. Now there is another problem that bothers us. Since DLL files play the role of a public function library, why can't we call it directly in a program and register it again? In fact, the registration of DLL files here is like the first time we went to school. Although you are sitting in the classroom, if you did not write your files, the teacher would not know you, naturally, you will not be found. Similarly, 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

After talking about the above, many of my friends may have heard it. Don't worry. It's much easier to understand the above hacker egsvr32 command.

As you know, all commands must have a format, and regsvr32 is no exception. 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 of regsvr32 is "regsvr32 [/u] [/S] [/n] [/I [: using line] DLL file name ",

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.

Commands are often hard to understand. Next we will use an instance to learn more about the regsvr32 command format. 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. 2 is the prompt window for normal task completion

Common error messages

After using the regsvr32 command for a long time, you may often see a variety of error prompts. Here I have found some representative errors to help you analyze and analyze them.

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 type of error is rare, but it is easy to appear on new users. The reason is that the file to be registered is not a normal DLL file or ocx file, and regsvr32 cannot complete registration at all. 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 "(of course, you have to ensure this ABC. the DLL file already exists and is completely correct)

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

This error is the same as in the previous example. The reason for this error is that the DLL file name is not specified, so regsvr32 naturally cannot know what operations to perform, this prompt is displayed. The solution is to specify the DLL file or ocx file to be operated.

Common error messages

After using the regsvr32 command for a long time, you may often see a variety of error prompts. Here I have found some representative errors to help you analyze and analyze them.

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 type of error is rare, but it is easy to appear on new users. The reason is that the file to be registered is not a normal DLL file or ocx file, and regsvr32 cannot complete registration at all. 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 "(of course, you have to ensure this ABC. the DLL file already exists and is completely correct)

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

This error is the same as in the previous example. The reason for this error is that the DLL file name is not specified, so regsvr32 naturally cannot know what operations to perform, this prompt is displayed. The solution is to specify the DLL file or ocx file to be operated.

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.