The Fastest Way to Delete Large Folders in Windows 11 Safely

Deleting large folders containing thousands of files using Windows File Explorer can take a very long time. What is a faster way to delete these files?

When you delete a file using File Explorer, Windows will perform calculations, analyze, and display updates as files and folders are deleted on the screen, something that usually takes time when deleting large folders with thousands of files and subfolders.

Before deleting the file, Windows should check whether the user has access rights to perform this action. If the user does not have access rights, then Windows will refuse to delete the file.

If the file you want to delete is being used by another application, Windows will try to disable the file before deleting it. This ensures that other applications will not lose the data that is being used by the file.

And if a file is being used or locked by another app, Windows won’t be able to delete that file until it’s no longer locked.

fast delete

However, you can speed up the file deletion process significantly by using a command-line approach. You can do it manually via Command Prompt (CMD) or create and run a batch file for quick removal. Both of these methods are much faster than the traditional way of deleting using Windows Explorer’s delete option.

How to Delete Large Folders Quickly Using Command Prompt (CMD)

You can use the delete command from Command Prompt, which will result in much faster completion of tasks compared to running the same process in Windows File Explorer.

  1. Open Command Prompt (CMD) by pressing the keyboard key (WIN + R) and typing “cmd” in the dialog box that appears, then press the “Enter” key.
  2. Navigate to the folder you want to delete by using the command “cd” (change directory). For example, if the folder you want to delete is on drive D and has the name “BardiminFolder”, then the command is:
d:
cd BardiminFolder
  1. Then type the following command to delete all files in the “D:\ BardiminFolder” folder.

This command will only delete all files inside the directory, and will not delete the subdirectories that are in it.

del /f/q/s *.* > nul
/f option to force read-only file deletion.
/q enables silent mode
/s run the command for all files in any folder inside the folder that you want to delete
*.* tells the del command to delete each file
> nul disabled console output to improve performance and speed

Make sure that you are in the folder you want to delete by using the “dir” command to display a list of files and folders in the current directory.

  1. As for deleting the directory, use the “cd..” command to go up to its parent folder. Next, use the following command to delete the directory.
rmdir /q/s folder_name
rmdir /q/s “BardiminFolder”
cmd change drive folder

It’s important to remember that the “rmdir” command will permanently delete the folder without moving it to the Recycle Bin, so make sure that you select the folder you want to delete.

How to Delete Large Folders Quickly Using File Bath

If you often delete large folders or do it regularly, using the method through Command Prompt as mentioned above becomes less effective. You can add how to delete it in the context menu of File Explorer.

This method will be easier and faster. You can simply open File Explorer, then right-click and select “Fast Delete”. To do this, follow these guidelines.

A. Create Fast Delete Bath Files

  1. Open Notepad and copy the following code.
@ECHO OFF
ECHO Delete Folder: %CD%?
PAUSE
SET FOLDER=%CD%
CD /
DEL /F/Q/S "%FOLDER%" > NUL
RMDIR /Q/S "%FOLDER%"
EXIT
  1. Save the file with the name “FastDelete.bat”. You can change it by any name.

Make sure you save the file using the (.bat) extension.

  1. Then move the file to the Windows folder, “C:\Windows”. You need to move the batch file to a location that is a PATH environment variable. In other words, you need to place a file. bat this in “C:\Windows” so that the Windows registry can access it easily.

B. Creating a Fast Delete Context Menu in File Explorer

  1. Press the keys (WIN +R) on the keyboard at the same time. This opens the “Run” dialog box.
  2. Type “regedit” in the “Run” dialog box and click “OK” or press the “Enter” key on your keyboard. This will open the Registry Editor.
  3. If a UAC (User Account Control) warning appears, click “Yes” to grant permission to open the Registry Editor.
  4. Then navigate to “HKEY_CLASSES_ROOT\Directory\shell\”
  5. Right-click on the “shell” folder and select the “New > Key” option.
  6. Next, name the new key “Fast Delete”. You can name whatever you like.
  7. Then in the “Fast Delete” folder you just created, right-click and select “New > Key” to create a new key.
registry fast delete context menu
  1. Name the key “command,”.
  2. Select your newly created “command” folder and on the right panel, double-click on “Default” to modify it.
  3. In the dialog box that appears, type cmd /c “cd %1 && FastDelete.bat. Click the OK button to save it.
  4. Restart your computer to see the results.

Latest Articles