If you do not enter safe mode, delete the files in use.

Source: Internet
Author: User

How can we delete the files in use by the system? In addition to DOS deletion, is there any easier way to save trouble?

In fact, apart from executing the DELETE command in DOS, you can still delete them in Windows. Specifically, the Wininit. ini file is used.

People who have used Windows 9x have seen the following prompts:
Please wait while Setup updates your configuration files.
This may take a few minutes ......

This is a normal phenomenon after a software or hardware driver is installed and Windows is restarted as required by the installation program. What is Windows doing? In fact, it is executing the command given by Wininit. ini. Wininit. ini is a little-known file. It is mainly used to delete, rename, and update files that cannot be subjected to these operations during Windows runtime. It exists for a short time, so it seems a bit mysterious.

As we all know, in Windows, if an executable file is running or a library file (*. dll ,*. vxd ,*. is in use, it cannot be rewritten or deleted. In addition, the driver library files and file subsystem library files are also displayed. If you want to upgrade these files, the changes must be made before the Windows protection mode core starts. Therefore, Windows provides a mechanism based on the Wininit. ini file to complete this task. This mechanism is to write the command into Wininit. ini in a certain format for applications that want to delete or rewrite such files.
When Windows restarts, it searches for Wininit in the Windows directory. if the INI file is found, follow the command to delete, rename, and update the file. After the task is completed, Wininit will be deleted. the INI file itself continues the startup process. Therefore, commands in the Wininit. ini file are executed only once.
The format of deleting a file using the Wininit. ini file is as follows:
[Rename]
Filename1 = filename2
......

Although the name is "rename", you can delete, rename, and update files. The Line "filename1 = filename2" is equivalent to executing the "copy filename2 filename1" and "del filename2" doscommands in sequence. Friends who have never used DOS may not know the meaning of these two commands. The following is a simple explanation. The command copy filename2 filename1 means to copy the "filename2" file and name the new file filename1. The command del filename2 means to delete the filename2 file.
At startup, Windows will overwrite filename1 with filename2, and then delete filename2. This achieves the goal of using filename2 and updating filename1. If filename1 does not exist, the actual result is to change filename2 to filename1; to delete a file, set filename1 to nul. For example, open notepad and enter the following content:
[Rename]
Nul = path ilename
......

[Rename] In wininit. ini can be used to delete and rename a file: "nul" indicates that the file is deleted, and "=" indicates the complete path name of the file you want to delete, note that the short file name ("C: Program Files" should be written as "c: progra ~ 1 "). This is because Wininit. ini files are processed before being transferred to the Windows File System, so long file names are not supported.

The following is a complete example. Suppose we want to delete notepad.exe, the program under C: Windows Folder. You can do this by opening notepad and entering the following content:
[Rename]
Nul = C: Windows otepad.exe

Save the edited file as the wininit. ini file and save it in the Windows System directory. Restart Windows. During the restart process, your notepad program and wininit. ini file will be deleted. In addition, if you want to delete folders, replace "dirnul" with "nul". Note that there is no space between "dir" and "nul". Remember to remember.

For another example, if you want to delete the Windows emp folder, you can open notepad and save the following content as wininit. the INI file is still saved in the Windows System directory. Restart your computer and enter Windows again. You will find that the temp folder has been deleted.
[Rename]
Dirnul = C: Windows emp

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.