Currently, there is specialized software for removing unnecessary files from a personal computer. In turn, the Windows operating system also has a built-in application for removing programs, games and other software. But for some users, the services provided by third-party software and regular OS tools are not to their liking. In this case, it remains to resort to the help of the console, known to users of the Windows operating system as a command line.
Using the built-in console, you can delete the file before the computer boots completely. This can come in handy if a malicious folder or document blocks the launch of the operating system. This material describes in detail how to delete files through the command line in the Windows OS.
Removing junk files using third-party software
Today, there are many companies that create specialized software for deleting junk files, as well as completely uninstalling installed applications, games and various multimedia programs. Using this kind of software, you, first of all, facilitate the maintenance of your computer and at the same time increase the life of the hard drive. Many users do not suspect how to delete files through the command line, and most importantly, is this possible.
Modern applications for cleaning garbage have many functions, ranging from clearing the cache and ending with the elimination of holes in computer security. The leaders among manufacturers of cleaning software are Wise, IObit, Auslogics, Priform. With the systematic cleaning of a personal computer of unnecessary files, its performance increases. But with all the advantages of this third-party software, it does not allow you to permanently delete files, folders and programs.
Removing files and applications using standard Windows tools
You can delete folders, files and programs through a special system application. These actions are also performed manually, with the subsequent cleaning of the operating system registry. The main disadvantage of this procedure is that the residual path to the file located in different directories is saved on the computer. That is why specialized software for cleaning a personal computer was developed. A folder with unnecessary files does not interfere with the work, but it will take up a lot of disk space. You can remove it only manually, if you do not resort to the help of the console.
Delete files through the command line: nuances
Given all of the above, the question arises: why and how to delete files through the command line, if it is easier to remove them using, for example, CCleaner or the Windows uninstaller. The answer is simple: it is necessary, first of all, to delete a file without the possibility of its recovery. And also in case of emergency blocking by malicious Windows startup software.
Before selling a used computer, many users resort to deleting folders and files through the command line, as it ensures that the information will not be restored.
How to delete files through the command line
Given the information above, we proceed directly to the removal of information through the command line. In order to carry out this operation, follow the detailed guide below:
- Hold down the Win + R keys.
- In the window that opens, interpret the cmd command.
- In the console that opens, write the command DEL / F / S / Q / A "Full path of the element with the extension."
- Example: DEL / F / S / Q / A "C: \ Games \ COD2.exe", where the folder is the game, COD2.exe is the name of the file with its extension (exe).
- Confirm the action by pressing the "Enter" key.
Thus, you can clear any folder from unnecessary txt files using the command line. Next, we will look at how to delete all files located in a folder with it.
Deleting files with and without confirmation: command line to help
You can delete not only one file, but also the entire contents of disks along with directories and subfolders in them. It is required to confirm or reject the action with the keys named Y - yes / N - no, in order to delete all files in the main directory and the folder tree nested in it. Follow the instructions below to perform a full removal using the console:
- Write the following command to the command line to confirm the deletion of all files: DEL / F / S / Q / A "Full path to the folder \ *".
- To delete files, use the command: DEL / F / S / Q / A "D: \ to trash \ *", where D: \ is the disk (you may have another one), "to trash" is the destination of the file to be deleted or folders.
- To delete the confirmation file, add / P, in which case the command will look like this: DEL / P / F / S / A "D: \ course \ *", where "course" is the file name.
- You can delete all files of the same extension from the folder, to execute, write the command DEL / F / S / Q / A "Full path to the folder \ * extension", where "extension" is the file type (for example, exe.)
Referring to the above instructions, it is clear that using the command line you can quite efficiently and quickly delete files from your computer. Upon obtaining sufficient skill, such operations are carried out in a matter of seconds.
Conclusion
Thus, from this article you were able to learn about how to delete files through the command line while using various methods of data cleaning. Also in this article, other methods for removing system trash and files from a PC using third-party software and standard Windows tools were considered. If something does not work out the first time, try repeating the above steps.