DOS file delete del command

Time:2021-3-3

The use of del command is very simple, just use the format of “del file path”. For example, if you want to delete the test.txt , using del D:\ test.txt That’s it.
However, not all files can be done with del command, such as files with hidden attribute, read-only attribute or system attribute\ test.txt It has a hidden attribute, if only del D:\ test.txt If so, D:\ test.txt It’s going to stay still. How to delete it? At this time, you need to add some auxiliary parameters to del. The hidden attribute is hidden, use del / A: H, the read-only attribute is read, use del / A: R, the system attribute is system, and use del / A: S. if you don’t know what the file attribute is, then you can use del / a – except in one case, when the file has the read-only attribute, you have to add del / A / F Therefore, if you want to delete the files that do not know the attributes, the Del / A / F statement is the safest way. Here, the / f parameter means to force the deletion of the read-only attribute file. F is taken from force, which means force.
For some time, the virus wreaked havoc on the Internet and destroyed many files. Among them, the most important thing is to generate one file in each directory desktop.ini Documents, just put these desktop.ini If the file is deleted, the virus will be harmless. To delete the desktop.ini File, if you click one by one sub folder to delete, it will be too much trouble, if you use the Del command, a simple statement can be done, that is: in the specified directory to execute del / A / F / s desktop.ini Orders. Here, / s means to search all the subfolders under the current directory and delete the specified file. S is taken from sub, which means “subordinate” and “subdirectory”.
Deleting a file is a very dangerous thing. If you are careless, you may delete an important file. Therefore, you need to be careful when performing the deletion operation. If you need to confirm before deleting, you can add a parameter / P.
Of course, for sure deletion operations, you don’t need to confirm one by one. You can choose the silent deletion mode. In this case, you need to use the parameter / Q, which is the abbreviation of quiet.