Key Points
- Large files and folders take significant time to delete using the conventional methods.
- Use this command in the Command Prompt to delete large files in the current directory in seconds: del /f/q/s *.* > nul
- To delete large folders, use this command instead: rmdir /q/s [FolderPath]
Deleting large files and folders is something that we have to live with while using a Windows computer. When deleting large files using File Explorer, it first scans and analyzes the total size of the items or the total number of items, and then begins to remove them, all the while reporting on its progress.
This method unnecessarily utilizes system resources on reporting which it could have spent on actually deleting the content.
Thankfully, you can now instantly delete large files and folders without wasting system resources using the Command Prompt. If using the Windows command line doesn’t work for you, you can add the option to the context menu throughout the Windows OS and delete any file or folder, regardless of its size, almost immediately from the context menu.
This post shows you the fastest methods to delete large items on a Windows computer using both the Command Prompt, as well as from the context menu.
On this page
Delete large file or folder from Command Prompt
We have already discussed how to delete files and folders using the Command Prompt. However, not all of the methods are for immediately deleting them; some still take a few seconds. The steps below will show you how to delete a large file or fall quickly using the Command Prompt.
Note: The methods given in the post delete the items permanently, after which the files and folders are unrecoverable and cannot be found in the Recycle Bin either.
-
Press the Windows Key + R to open the Run Command box.
-
Type in “cmd” and then press CTRL + Shift + Enter to open the Command Prompt with elevated privileges.
Administrative rights may be required to perform an action on some files and folders.
-
Now use the
CD
command to change the directory to the folder that you want to delete.CD /d [PathToFolder]
-
Now run the following command to delete everything within that folder without showing an output:
del /f/q/s *.* > nul
The
Del
command means delete, the/f
switch forces the command, and the/q
switch is used for quiet mode, which means that no user input will be required. The/s
switch is used for recursive mode, so all subfolders and their items will also be deleted from the current directory. The “*.*
” is used to select everything (any file name and any file extension), and the “> nul
” is used to disable the console output.
In the example above, we placed a 20 GB file in the “TestFolder,” and it took nearly 1 complete second for this command to delete the file.
If you wish to delete the entire folder, then use this command while replacing the variable with the folder path:
rmdir /q/s [PathToFolder]
If you are not a fan of the command line, then you can also include the quick-delete option right in the Windows context menu. This way, all you will need to do is right-click any large file or folder and quickly delete it.
But first, you must perform the following steps to include the option in the context menu.
Note: The process involves making changes to the Windows Registry. Misconfiguration of critical values in the system’s registry could be fatal for your operating system. Therefore, we insist that you create a system restore point or a complete system image backup before proceeding forward with the process.
You can also use our top selection of disk imaging and backup software so you never lose your data or operating system again.
-
Search for “Notepad” in the Start menu, right-click it, and then click “Run as administrator.”
-
Paste the following text:
@ECHO OFF ECHO Delete Folder: %CD%? PAUSE SET FOLDER=%CD% CD / DEL /F/Q/S "%FOLDER%" > NUL RMDIR /Q/S "%FOLDER%" EXIT
-
Click File and then click “Save as.”
-
Browse to the following path to save the file:
C:\Windows
-
Set the “Save as type” to “All files.”
-
Enter a name for the file followed by “.bat“.
Note: Remember the complete file name as it will be needed later.
-
Click Save.
-
Press the Windows Key + R to open the Run Command box.
-
type in “regedit” and press Enter.
-
Navigate to the following path from the left pane:
Computer\HKEY_CLASSES_ROOT\Directory\shell\
-
Right-click the Shell key, expand New, and click Key.
-
Name the key “Fast Delete“.
-
Right-click the “Fast Delete” key, expand New, and click Key again. This time, name the key “command“.
-
Double-click the “Default” string value in the command key, and then paste the following in the Value Data field while replacing the name of the batch file with the one you set in Step 6 above.
cmd /c "cd %1 && [BatchFileName].bat"
-
Click Ok and restart the computer.
Now, when you right-click a large folder, you will see the option “Fast Delete,” which will quickly delete the folder permanently.
Closing words
Do not waste your time or your system resources in deleting items that are significantly large. Instead, use any of the two methods stated in this article to permanently delete large files and folders in a jiffy.