Learn more about INF files

Source: Internet
Author: User

Learn more about INF files
Everyone knows that there are countless INF files in my computer, but few know what the INF file is. At best, it only stays at the awareness that the INF file can unlock the locked registry. So what 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, short for device information file, is a file format launched by Microsoft for hardware device manufacturers by publishing their drivers, 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. Drivers required to install monitors, modems, printers, and other devices all use the INF file. It is the credit of INF that Windows can find drivers for these hardware devices and install them correctly. When we add system components through "Start> Control Panel> add and delete Programs> Windows Installer", the INF file is automatically called. In other cases, you must 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 node name can contain a maximum of 255 characters (in Windows 2000/XP/2003 operating systems) or 28 characters (in Windows 98 operating systems ). 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 the content of a single entry is too large to be fully written in one row, use "/" to write the content of a 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. If an entry such as "Signature =" $ Chicago $ "appears in this section, it indicates that the INF file applies to all operating systems after Windows 98, if an entry such as "Signature =" $ Windows NT $ "indicates that the INF file is applicable to Windows 2000/XP/2003 operating systems, and either of them is required.

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 (multimedia device, such as sound card), net (network device, usually Nic), modem (modem), printer (Print Device), image (image capture device, such as 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.

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:

Program code
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.

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. In the Windows directory of the system disk, scanreg.ini.pdf is provided. The default operations performed by scanregw.exe every day are under its control. We can use this principle to back up important files.

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 in "scanreg. ini "has the following annotation content"; Files = [dir code,] file1, file2, file3 ", remove the annotation symbol, you can DIY the important files that need to be backed up by the Registry check program. By default, when the Registry check program creates a registry backup file. dat "," system. INI "," user. dat and win. INI files are stored in the "cab" compressed file. If you need to add other important system configuration files to this compressed file, you can enter "[directory Code], file name 1, file name 2, and file name 3" after "files =". The file names are 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.


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

Open = D:/program files/foobar2000/

Foobar2000.exe 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 the location of the player." D:/Qs. FPL is the playlist file of foobar2000 player. You can also replace it with the path of a specific music file. If you use Winamp, 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 the "setup" program icon in the "/tools/reskit/batch" directory of the Windows 98 installation disc to install the batch98 tool.

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.

When you need to reinstall Windows 98, use the boot disk to enter the DOS prompt and the "msbatch. insert the INF file into the floppy disk, insert the Windows 98 installation disc into the optical drive, and 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.


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, no response indicates that 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> System Tool> disk fragment program" step by step ", select the partition to be sorted in the pop-up drive selection window, and then click the "fragment" button to start sorting. This is troublesome. You can try adding the Disk Manager 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 ).

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 -- applicable to Windows XP and atii9xxx. INF -- applicable to Windows 9x and atii2kxx. INF applies to Windows 2000.

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.

Search for 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 file.

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?

Enter "rundll32 syssetup, setupinfobjectinstallaction defaultinstall 128 inf file path and file name. inf" at the command line prompt, and press enter to install the corresponding inf file.

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.