Windows inf file

Source: Internet
Author: User

Everyone knows that there are countless INF files in my computer, but few know what the INF file is. At best, only the INF file can unlock the locked note.
What exactly is the INF file and what is the INF file capable? Today, let's join us in the mysterious world of INF files.

Unveil the secret of the INF file

INF is device information
File is a file format released by Microsoft for hardware device manufacturers. The inf file contains hardware device information or scripts to control hardware operations.
. The inf file specifies how the hardware driver is installed in the system, where the source file is, which folder the driver is installed in, and how to add relevant information to the Registry. Install monitor, modulation and demodulation
The drivers required by devices such as printers and printers are all based on the INF file. It is the credit of INF that Windows can find the drivers of these hardware devices and install them correctly. When we use "Start →
When the control panel → add or delete programs → Windows Installer "is used to add system components, the INF file is automatically called. In other scenarios
Right-click the INF file and select "Install" to install the application.

A large number of INF files are stored in the C:/Windows/INF folder. This folder is generally hidden. If you want to view this folder, you can select View> folder option> View ", select "show all files" under "files and folders ".

Anatomy of the INF file structure

The inf file is actually a plain text file, which can be opened and edited by any text editing software, such as Notepad and wordpad. The inf file has a set of writing rules, and each inf file is strictly written according to these rules.

* Rule 1: The inf file is segmented. Each inf file contains many sections, and the section name is enclosed in square brackets. Some of these node names are defined by the system and some are customized by the user. Each section
The name cannot exceed 255 characters (in Windows 2000/XP/2003 operating system) or 28 characters (in Windows
98 ). There is no sequential difference between a section and a section. In addition, if two identical node names appear in the same inf file, the system automatically merges the entries under these two node names.

* Rule 2: The content between a section is an entry. Each section is composed of multiple entries, each entry is in the form of Signature = "$ Chicago $. If there are multiple values after an equal sign for each entry, separate each value with a comma.

* Rule 3: The inf file is case-insensitive.

* Rule 4: The content after ";" is a comment.

* Rule 5: if a single entry contains too many contents and cannot be fully written in one row, use "\" to write a single row into multiple rows.

After understanding the rules of the INF file, let's dissect the structure of the INF file together.

1. Version Section

Each inf file contains such a section. The entries in this section mainly describe the device types supported by this INF file and the applicable operating system. In this section, if "Signature =
"$ Chicago $" indicates that the INF file is applicable to Windows
For all operating systems after 98, if an entry such as "Signature =" $ Windows NT $ "is contained, the INF file applies to Windows
2000/XP/2003 operating system, and the two must have one.

In addition, the "class" entry in this section is very important. It indicates the device type. Common types include:
Display (display device, such as video card), media (such as sound card), net (network device, usually Nic), modem (modem), printer
(Print Device), image (image capture device, such as a camera ).

2. Manufacturer Section

The entries in this section mainly describe all hardware devices that can be identified by the INF file, including the manufacturer of the device so that the device can be correctly installed. For example, "% ATI % = ATI" indicates that the manufacturer of the device is "ATI". This is no stranger to everyone. It is the manufacturer of the video card.

3. sourcedisksnames

This section mainly specifies the media where the installation file is located. For example, "1 =" ATI
Drivers release cd "indicates that all drivers are on the retail edition of the CD disk.

4. sourcediskfiles

Driver file list and installed location. This section must be combined with the [sourcedisksnames] section to know the specific location. For example, "atinbtxx. sys = 1", you must go to [destinationdirs] to view the location where "1" represents.

5. destinationdirs Section

The inf file instructs the installer to copy some files to the hard disk during installation, or delete or rename some files on the hard disk. This section specifies the target path of the file to achieve the above purpose.

6. defainstall install and install

This section describes the actual properties of the device driver and hardware device. By default, run the [defainstall install] section, which specifies the files to be copied or deleted, registry updates, INF file updates, and so on, it also contains pointers to other sections.

7. string section

This section defines string variables. When some strings frequently appear in the INF file, to simplify the input, you can define a string variable in this section, indicates that the string appears in the INF file.

Understand the INF file

Let's take the WDM driver for Windows XP Of The ATI graphics card as an example to illustrate the specific meaning of the INF file. Because the INF file is often very long, in order to illustrate the convenience, we deleted most of the information and only kept the structure of one inf file, as shown in 1.

Figure 1

INF file highlights

Let's look at the typical applications of several INF files.

1. open the locked Registry

Step 1: Open the Notepad program and enter the following content:


Signature = "$ Chicago $"

[Defainstall install]

Delreg = deleteme


Hkcu, "Software \ Microsoft \ Windows \ CurrentVersion \ Policies \ System", "disableregstrytools"

HKLM, "Software \ Microsoft \ Windows \ CurrentVersion \ Policies \ System", "disableregstrytools"

Enter the name and save it as unlock. INF. The name is required and the extension must be INF.

Step 2: Right-click the "unlock. inf" file and choose "Install" from the shortcut menu. As shown in figure 2, the locked registry is opened in response.

Figure 2

2. cleverly use the INF file to automatically back up important files

As we all know, the Registry is the root of the Windows operating system. Therefore, when the system starts, the Registry check program is automatically run to automatically update the backup registry file. On the system disk

Step 1: Open the resource manager, find the file, and open it with the Notepad program. We can clearly see that there are five parameters in total ,.

(1) The backup parameter value can be 0 or 1. The default value is 1. If the value is 1, the Registry is scanned at the first startup every day. If the value is 0, no registry operation is performed.

(2) The value of optimize can be 0 or 1. The default value is 1. If the value is 1, redundant data in the registry is deleted every time the registry is scanned to optimize registry data. If the value is 0, no deletion operation is performed.

(3) scanregversion = 0.0001 program version description.

(4) The maxbackupcopies parameter is used to set the number of created backup files. The value ranges from 5 to 99. The default value is 5, which means up to five backup files can be created, to better protect the system, it is generally recommended to set about 10.

(5) The backupdirectory parameter is used to set the directory for storing backup files. The default directory is Windows \ sysbckup. Note that the complete path must be entered here.

(6) files has the following comment at the end of "scanreg. ini"; Files = [dir
Code,] file1, file2, file3 ", remove the annotator"; "before it, and you can DIY the important files that need to be backed up by the Registry check program. Default
When the Registry check program creates a registry backup file, four files: "system. dat", "system. ini", "user. dat", and "win. ini"
Save it in the "cab" compressed file. If you need to add other important system configuration files to this compressed file, enter "[directory Code] After" files = ". file Name 1, file name
2, file name 3 ", separated by commas (,), the directory code meaning is as follows:

10 represents the C: \ Windows Directory

11 represents the C: \ WINDOWS \ SYSTEM directory

30 represents the C root directory

31 represents the root directory of the disk where the Windows system is located

For example, to put the autoexec. BAT and config. sys files into the backup file, you can set the parameter to "file = 30, config. sys, autoexec. Bat ".

3. Hard drive (USB flash drive) also requires personalization

1. Give the hard drive (USB flash drive) a cute DIY icon

First, we replace the hard drive icon with our favorite icon and place it in a beautiful color. First, prepare an icon file. You can use the icon maker to create your own icon file, or use a ready-made icon file. It is best to save it to the root directory of a partition on the hard disk. Open the Notepad program and enter the following content:


Icon = *****. ICO

* Is the path of the icon file and the name of the icon file. You must change it to the path and name of the icon file. After the input is complete, save it as "autorun. inf" and cut it to the root directory of a partition that you want to cool up.

Second: Let the hard drive dance

If you double-click the hard disk partition or right-click and select "auto play" from the shortcut menu, as shown in 3, the music playing program is automatically started to play the music file, let the beautiful music moments surround your left and right. Come on.

Figure 3

Enter the following content in the "autorun. inf" file:

Open = D: \ Program
Files \ foobar2000
D: \ Qs. FPL

Where "d: \ Program
Files \ foobar2000
Foobar2000.exe "is the location of my favorite player foobar2000. If you are using Winamp or another player, replace it with a specific player.
The location where "D: \ Qs. FPL" is the playlist file of the foobar2000 player. You can also replace it with the path of a specific music file. If you are using
Winamp indicates that the playlist file should be "*. m3u ". This method can also be used to automatically play video files when you double-click a hard disk partition.

4. Unattended Installation of Windows 98

There is a batch tool in the Windows 98 installation CD, which can be used to create scripts for unattended installation, this is to generate an INF file that contains various information that needs to interact with the installation wizard during Windows 98 installation-msbatch. INF.

First, find
98 install the cd "/tools
Install the batch98 tool by using the "setup" program icon in the/reskit/batch directory.

Run the batch tool, generate the "msbatch. inf" file according to the wizard prompts, and save the file to a floppy disk. For details about the generation method, refer to relevant materials.

To reinstall windows
At 98, use the boot disk to enter the DOS prompt, insert a floppy disk with the "msbatch. inf" file to the floppy drive
98 install the CD and insert the optical drive. Enter the following command at the DOS prompt: "X:/Win98/setup
A: msbatch. inf ". Press enter. "X" indicates the optical drive and drive letter.

5. Right-click the screen saver and choose menu

When we leave for a while, the screen saver with a password can protect our current operations from being peeked at by others. However, in the default settings, the screen saver can only be started one minute later. How can we quickly activate the screen saver?

The most common method is to create a shortcut to enable screen saver on the desktop. You can simply double-click it as needed. In addition, we can also right-click the screen saver menu!

Step 1: Open the Notepad program and enter the following content:


Signature = "$ Chicago $"

[Defainstall install]

Addreg = addme


Hkcr, "CLSID \ {20d04fe0-3aea-1069-a2d8-08002b30309d} \ shell \ pingbao", "Screen Saver"

Hkcr, "CLSID \ {20d04fe0-3aea-1069-a2d8-08002b30309d} \ shell \ pingbao \ command", "ssstars. scr
/S \ "% 1 \""

After the input is complete, check the file name and save it as "pingbao. inf". The file name can be used and the extension must be INF.

Step 2: Right-click the "pingbao. inf" file and choose "Install" from the shortcut menu ".

Step 3: When you need screen protection, go back to the desktop and right-click "my computer" and choose "Screen Protection", as shown in figure 4. Click it and try to see if the Screen Saver is started immediately.

Figure 4

Note: "ssstars. SCR is the name of the screen saver file to be started. Replace it with your favorite screen saver file. If you right-click the screen saver option in the menu, if no response is returned, the screen saver is not started. Change "/s \" % 1 \ "in the text to" \ "% 1 \"/s.

6. Right-click the disk management program and choose menu

Regular disk sorting is a task we often do. Each time we click "Start> program> attachment> step by step
System Tools → disk fragment Program ", select the partition to be sorted in the pop-up select drive window, and then click the" fragment "button to start sorting. This is troublesome. We can try
Add the program to the right-click menu.

Step 1: Open the Notepad program and enter the following content:


Signature = "$ Chicago $"

[Defainstall install]

Addreg = addme


Hkcr, "\ drive \ shell \ disk arrangement \ command", "defrag.exe % 1"

Enter the name and save it as adddefrag. INF. The name is required and the extension must be INF.

Step 2: Right-click the "adddefrag. inf" file and choose "Install" from the shortcut menu ".

Step 3: To sort disks in the future, you only need to open the resource manager, right-click the drive letter, and select "disk sort" from the shortcut menu (5 ).

Figure 5

7. Solve the problem that ATI graphics cannot install the public drive

Some third-party ATI graphics cards cannot install the public version of the driver, which is caused by many reasons. For example, some third-party manufacturers have made changes to the hardware, non-public PCB design and BIOs are adopted, which may lead to the failure to install the public edition driver. What should I do when your video card encounters this problem?

First, extract the downloaded atigraphics card driver to any directory on the hard disk. In the "atidrive" subdirectory, all INF files will be listed. atiixpxx. inf
-- For Windows XP and atii9xxx. inf -- for Windows 9x and atii2kxx. inf for Windows

Next, open the INF file corresponding to the operating system, and find "Ati. MFG string, then you will see "radeon 7000, radeon 7200, radeon 7500, radeon 8500" and other entry information, delete it.

Next, find the matching string with your video card, for example, the author's radeon 7500 video card, find "radeon 7500" and find the following information: "radeon
7500 = ati2mtag_rv200, PCI \ ven_1002 & dev_5157 &&
& Subsys_013a1002 ", delete & subsys_013a1002, and save the text

Try again now to see if the problem is resolved.

8. Install the INF file under the command line

Generally, we install the INF file in windows, but what if one day you need to run the INF file on the command line?

Rundll32 syssetup, setupinfobjectinstallaction defainstall install 128 inf file path and file name. inf ", press enter to install the corresponding inf file.

Related Article

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