How to delete large folders in Windows super fast

Martin Brinkmann
Jul 18, 2017
Updated • Oct 1, 2021
Windows, Windows tips

The fastest way to delete large folders and files in Windows is to take the command-line approach. You could either do it manually via CMD or create and run a batch file for quick deletion. These two methods are a lot faster than the traditional way of deleting using the Windows Explorer delete option.

But before I go through the superfast way to delete large folders, here’s the reason why it takes so much time. If you are in a hurry, jump to the next section for the solution.

Why Does Windows Take Time to Delete Large Folders?

When you delete huge folders in Windows, you will notice that the process takes quite a bit of time to complete. It is the opposite of fast.

I keep backup folders of gHacks locally on a platter-based drive, and these folders come close to 30 Gigabytes in size with more than 140,000 files and 350 folders.

When I need to delete them again, it takes a long time if I run the delete operation in Windows Explorer. The problem is that Windows prepares to delete first. This includes running calculations first, which, in itself may take a very long time to complete. Then comes the deletion part, even if you choose to delete the folders permanently (force delete).

Then when the actual deleting takes place, Windows analyzes the process and posts updates to the file operation window.

It may take ten or twenty minutes, or even longer, to delete a large folder (of size greater than 10 GB, for instance) from your hard disk using Explorer on Windows devices.

Delete Large Folders in Windows Quickly Using CMD

If you run delete commands from the command line instead, you will notice that the operation completes a lot faster. You may notice that the operation needs just a fraction of the time that the same operation requires when you run it in Explorer.

Using CMD in Windows XP/7/10 to delete huge folders

Matt Pilz, who wrote about this back in 2015 saw a reduction from 11 minutes to 29 seconds, which made the command line operation more than 20 times faster than the Explorer option.

The downside to this is that it requires the use of the command line. Matt suggested adding the commands to the Explorer context menu so that users could run them in Explorer directly. This makes it both faster and easier.

The two commands that users require are Del, for deleting files, and Rmdir, for removing directories.

Here’s the step-by-step process to delete large folders using CMD:

  1. Tap on the Windows-key, type cmd.exe and select the result to load the command prompt.
  2. Navigate to the folder that you want to delete (with all its files and subfolders). Use cd path, e.g. cd o:\backups\test\ to do so.
  3. The command DEL /F/Q/S *.* > NUL deletes all files in that folder structure, and omits the output which improves the process further.
  4. Use cd.. to navigate to the parent folder afterwards.
  5. Run the command RMDIR /Q/S foldername to delete the folder and all of its subfolders.

Here are descriptions of each of the commands used above.

DEL /F/Q/S *.* > NUL

  • /F -- forces the deletion of read-only files.
  • /Q -- enables quiet mode. You are not asked if it is ok to delete files (if you don't use this, you are asked for any file in the folder, which can be time-consuming and therefore counter-productive).
  • /S -- runs the command on all files in any folder under the selected structure.
  • *.* -- delete all files.
  • > NUL -- disables console output. This improves the process further, shaving off about one quarter of the processing time off of the console command.

RMDIR /Q/S foldername

  • /Q -- Quiet mode, won't prompt for confirmation to delete folders.
  • /S -- Run the operation on all folders of the selected path.
  • foldername -- The absolute path or relative folder name, e.g. o:/backup/test1 or test1

Method #2: Creating a Batch File for Quick Deletion

If you don't need to run the command often, you may be perfectly fine running the commands directly from the command prompt.

However, if you do use it frequently, you may prefer to optimize the process. You may add the command to the Explorer context menu so that you can run it from there directly. This saves even more time without depending on a third-party software.

For this, the first thing you need to do is create a batch file. Create a new plain text document on Windows, and paste the following lines of code into it.

ECHO Delete Folder: %CD%?
CD /

Save the file as delete.bat afterwards. Make sure it has the .bat extension, and not the .txt extension. You can do this by selecting Save as type as All Files.

The batch file comes with a security prompt. This provides you with an option to stop the process; important if you have selected the context menu item by accident. You can use CTRL-C or click on the x of the window to stop the process. If you press any other key, all folders and files will be deleted without any option to stop the process.

You need to add the batch file to a location that is a PATH-environment variable. While you may create your own variable, you may also move it to a folder that is already supported; e.g.: C:\Windows. In other words, you need to place this .bat file in C:\Windows so that the Windows registry can easily access it.

Adding batch file to Windows registry

Do the following to add the new batch file to delete folders quickly to the Windows Explorer context menu. This can be executed in all major versions of Windows including Windows XP, Windows 7, and Windows 10.

  1. Tap on the Windows key, type regedit.exe, and tap in the Enter key to open the Windows Registry Editor.
  2. Confirm the UAC prompt.
  3. Go to HKEY_CLASSES_ROOT\Directory\shell\
  4. Right-click on Shell and select New > Key.
  5. Name the key Fast Delete
  6. Right-click on Fast Delete, and select New > Key.
  7. Name the key command.
  8. Double-click on default of the command key.
  9. Add cmd /c "cd %1 && delete.bat" as the value.
Fast Delete option in Windows Explorer context menu


If you want to speed up the deletion process even further, you can always check some third-party tool like byenow.

Article Name
Delete Large Folders in Windows Superfast Using CMD
Delete large folders on Windows using command line operation. Or create a batch file to quickly delete heavy folders in Windows XP/7/10 via context menu.
Ghacks Technology News

Tutorials & Tips

Previous Post: «
Next Post: «


  1. Anonymous said on April 18, 2022 at 8:31 am

    how to restore back file if i accidentally delete file using bat

  2. Patrick said on January 31, 2022 at 6:59 pm

    it couldn´t delete 2 ISO files i have downloaded,, my win 10 says that the files are open in system and can´t be deleted…

    so how do i go by and create a bat file that deletes the directory before win10 loads up fully?…

  3. daffafasfdasdasd said on January 15, 2022 at 6:13 am

    yeah that fast delete shortcut in the menu seems risky lol

  4. Hell Yeah said on March 24, 2021 at 2:13 am

    This looks like a great thing to add to a scammers startup programs

  5. lingar said on October 11, 2020 at 10:31 am

    This batch file is very dangerous ! Need to be noticed on. My luck that I have tried it on draft area. It’s removing all files inside the folder without undo options/

  6. rather not say said on July 26, 2020 at 2:20 am

    this trashed all my documents including work files. I almost got fired. it also deleted my program that i was about to release to the public. Bot. It is a batch file that has gui , it talks , it runs , it lets you play solitare , and searches google. It took 2 years to finish the project that your program deleted. —–

  7. Technolong.Com said on March 10, 2020 at 6:34 pm

    Once you ve completed the steps, you can right-click a folder and select the Quick Delete option to remove a large folder super fast.

  8. Mohamed said on February 15, 2020 at 9:51 am

    unless you have made a backup for the whole windows files,
    I found that this registry shell method deleted my system files, now my windows is DOWN

  9. lgp1985 said on January 14, 2020 at 1:50 pm

    just don’t create the .bat for creating the Windows Explorer Context Menu.
    Define the (Default) value as: cmd /c “pause && del /s/q/f %1 > nul && rmdir /q/s %1″

    Or save text below line as fast_delete.reg on desktop and double click it.
    Windows Registry Editor Version 5.00

    [HKEY_CLASSES_ROOT\Directory\shell\Fast Delete\command]
    @=”cmd /c \”pause && del /s/q/f %1 > nul && rmdir /q/s %1\””

  10. Anonymous said on October 28, 2019 at 1:08 pm

    Thanks. :-)

  11. Anonymous said on September 4, 2019 at 1:41 pm

    Hello 2019!

    Anybody else came here just to delete node_modules folder?

    1. Asad Malik said on January 31, 2020 at 10:50 pm

      :D :D Me too!!!

    2. Greg said on December 18, 2019 at 1:56 pm


  12. Kevin said on June 29, 2019 at 11:53 pm

    Be sure to keep the delete prompt in the batch file, and ACTUALLY PAY ATTENTION TO THE MESSAGE before deleting. It seems that attempting to “Fast Delete” things from the Quick Access area of a Windows Explorer menu will result in a message of “Delete Folder: C:\Windows\system32?”

    Easy way to ruin one’s day!

    1. Kevin said on June 29, 2019 at 11:54 pm

      Clarification – it’s not the Quick Access I was referring to, but rather when you drill down through the file system on the left side.

  13. Iuri Matos said on June 1, 2019 at 5:28 pm

    How delete ready-only files? tried your script but get “access denied”

  14. Anonymous said on May 2, 2019 at 2:23 pm

    Thanks so much this really helped me

  15. Anonymous said on April 18, 2019 at 3:08 pm

    what about long file names.

    1. Martin Brinkmann said on April 18, 2019 at 3:12 pm

      What do you mean?

  16. DGrv said on April 16, 2019 at 9:55 am

    I succeeded I think in an easier way : Just create a new registry key to right click and delete. It will not prompt for confirmation though

    Windows Registry Editor Version 5.00

    @=”cmd /c \”cd \”%1\” && DEL /F/Q/S \”%1\” > NUL && RMDIR /Q/S \”%1\”\””

  17. jezza said on November 23, 2018 at 11:42 pm

    the regedit thing doesnt work for me. it says “system cannot find the specified path”

    1. Martin Brinkmann said on November 24, 2018 at 7:47 am

      Did you add the batch file to a location in PATH? It won’t get picked up otherwise.

  18. L0eNNe555 said on November 2, 2018 at 10:35 pm

    So I spiced this up a bit.
    First by making a VERY clear warning and using a double confirmation before starting the procedure.
    My delete.bat looks like this:

    ECHO _,.—–.,_
    ECHO ,-~ ~-. +———————+
    ECHO ,v___ ___v. + !!! WARNING !!! +
    ECHO /~” ~” . “~ “~\ +———————+
    ECHO 1 ,–.__ I __.–. 1
    ECHO 1 Y ~-. 1 ,-~ Y 1 Really quick-delete Folder: “%CD%”?
    ECHO 1 O }:{ O 1
    ECHO .-~ (___,.–” .v. “–.,___)~-. THIS PROCEDURE CANNOT BE UNDONE!
    ECHO \.____, ~ \/”\/ ~ .____,/ NO PAPERBIN INVOLVED!
    ECHO .____ ____.
    ECHO \ \1_1_1_1_1_1/ / /
    ECHO \ [T T T T T TI /
    ECHO 1 `v-v-v-v-v’ 1
    ECHO \. ,/
    ECHO “^-.__,-^”
    ECHO PRESS “STRG-C” to ABORT procedure or CONFIRM by pressing any key twice…
    ECHO =========================================================================
    CD /
    DEL /F/Q/S “%FOLDER%” > NUL
    ECHO =========================================================================
    ECHO =========================================================================
    ECHO +===================================================+
    ECHO + FAST-DELETE BATCH proudly presented by L0eNNe555 +
    ECHO +===================================================+
    ECHO +===================================================+

    Second, as Shawn correctly stated, I altered the registry CD command by adding the /d modifyer, so the command also safely changes harddrives in case you are deleting a folder on any drive other than C.
    Looks like this:

    cmd /c “cd /d %1 && delete.bat”

    Thank you all for guidance and inspiration!

  19. tony said on November 1, 2018 at 3:48 am

    try the rdpro please

    Rapid Delete Pro- recursively delete files and directories for Window, MacOS, Linux/Unix .
    a free , open source

    1. senglory said on May 9, 2020 at 10:21 am

      Wow! Works at the spped of light!

  20. John Teller said on June 7, 2018 at 1:58 pm

    You can also use robocopy:

    With robocopy, you can also delete too long paths.

  21. Shawn said on June 3, 2018 at 10:32 am

    This will cause issues:
    ` cmd /c “cd %1 && delete.bat”

    You should use pushd instead of cd, as it changes drive as well. Or use the /d switch of cd. Otherwise, it will purge the default directory (likely system32 or your user profile folder) if the directory you’re trying to purge isn’t on the C: drive.
    ` cmd /c “cd /d %1 && delete.bat”

    1. No Name said on January 9, 2020 at 4:35 pm


  22. PeaceByJesus said on January 23, 2018 at 9:49 pm

    Created the batch file in W/10 64 bit but it would not let me place it in Program files, so i put it in the default documents folder, and did the rest as instructed (and restarted explorer.exe). But when i choose a folder to delete and hit Fast Delete in the R. click ,menu, then the command prompt flashes into view for a second but nothing happens.

    So i installed unlocker and which provides a Delete option and which worked quickly. Thank God for those who make such helps. I send some feedback to MS on this also:

    If you choose a folder to be deleted, such as a 2GB folder in the C drive on a SSD hard drive, then it takes over 7 minutes just to calculate it. Even with a 4.2 Ghz 4-core CPU. You need a fast delete right click option.

  23. Shadess said on November 25, 2017 at 5:45 pm

    Just noticed my Vivaldi JumpListIcons folder has inside it, in one folder, 600k files. On a slow laptop 5400rpm HDD seems pretty impossible to delete with more conventional ways. First letting windows try and calculate how many files are actually inside the folder and afterwards will give this method a try.

    Googled for a better way and ended up here, should’ve known ghacks to be on it!

    1. Shadess said on November 25, 2017 at 9:18 pm

      Still on track to taking about 13h or so for me even with this :<

  24. jo said on November 15, 2017 at 12:38 pm

    The answer to warns:

    “Be very careful. If you have a symbolic link that is a directory (made with mklink /d) then using DEL will delete all of the files in the target directory (the directory that the link points to), rather than just the link.

    Solution: RMDIR on the other hand will only delete the directory link, not what the link points to.”

    1. senglory said on May 9, 2020 at 9:38 am

      Same for me, Win 10 x64 Pro

  25. kjstech said on October 16, 2017 at 3:19 pm

    I tried putting this in a context command but it didn’t work. It splattered “Access denied…” a million times in a command window.

    I found I have to right click cmd, run as admin, navigate into the folder that I want deleted, then run delete.bat.

    I know it sucks, even when your logged in as an admin, Windows Server 2012 R2 still doesn’t treat you like one.

    I’m not sure how to do a right click and select “run as administrator” to get the UAC box to pop up all in a registry command.

    1. Anonymous said on March 14, 2019 at 8:46 am

      Same :/

  26. George said on October 14, 2017 at 6:07 pm

    Brilliant, thank you for the tip.

  27. Mountainking said on July 19, 2017 at 8:36 am

    How about using shift+delete @martin? Is super fast for me…..

    1. Martin Brinkmann said on July 19, 2017 at 11:09 am

      It should not be super fast if the folder is huge (meaning lots of files and folders inside).

  28. oh well said on July 19, 2017 at 7:57 am

    keeping backups in archives =?

  29. CHEF-KOCH said on July 19, 2017 at 2:56 am

    RD should’t be used since it’s slower.

  30. recuva said on July 19, 2017 at 12:37 am

    Seems similar to using [Shift + Delete] key combination which omits the recycle bin, is it?
    However, the files and folder will still reside on the drive and easily recovered until overwritten by new files, or by old files growing in size, overwriting of the old content there’s still no quick way afaik.

    1. None said on July 31, 2020 at 11:14 am

      No, shift DEL still does the pointless calculation.

  31. Doc said on July 19, 2017 at 12:19 am

    A slightly shorter alias for RMDIR is RD.

    C:\Windows\System32>rd /?
    Removes (deletes) a directory.

    RMDIR [/S] [/Q] [drive:]path
    RD [/S] [/Q] [drive:]path

    /S Removes all directories and files in the specified directory
    in addition to the directory itself. Used to remove a directory

    /Q Quiet mode, do not ask if ok to remove a directory tree with /S

  32. Berlin said on July 18, 2017 at 9:16 pm

    Hi Martin I have coded a small vbs script to simplilfy the whole process , if someone wants to add the Fast Delete Option to his Folder context menu he can just download and unzip the following file and use the “Fast_Delete.vbe”
    Note: first click will add the fast delete Option and second click will remove the fast delete option

    1. To Berlin said on August 5, 2022 at 3:24 am

      Is it possible to make the same file, using byenow to delete stuff?
      Thanks in advance.

  33. Emil said on July 18, 2017 at 8:38 pm

    Why, RMDIR /S will delete files in subdirectories anyway. Instead of three lines the last one is actually enough.

    No idea what Explorer does with deletion jobs either, it’s a bit sad…

  34. jasray said on July 18, 2017 at 6:53 pm

    A rather old post, but I would much prefer to see something a bit more comprehensive:

    Yes, these are copy utilities, but most have delete capabilities. Fast Copy is good for all things with an updated version:

    No mention of Linux–say, boot into a Live distro and delete files.

    No mention of the inherent bias of the hardware in use. Does it matter? Difference in deletion from a SSD versus a HDD and the processor in use? No idea . . . .

    An article still bound by utilities offered by Windows–does anything change with a third party program? Like boosting acoustical quality with DFX or some such tool?

    Por la tanto . . . .

    1. Kalin said on August 27, 2019 at 7:37 pm

      Linux has read-only NTFS abilities, so no, you cannot delete files off of an NTFS volume via a linux distro. This article is specifically for Windows, what did you expect? Why would you want to add another piece of software into the mix? This is the cleanest and fastest way to do it. Seems like you’re just finding things to complain about rather than just appreciating what the author has done to write about this.

      Be more positive!

      1. BradN said on October 20, 2019 at 9:13 pm

        Not correct; there has been a read-write capable driver usable in Linux for over a decade now. It probably won’t be faster than file deleting in Windows though, because it’s a user-mode driver via FUSE.

  35. TelV said on July 18, 2017 at 4:41 pm

    There are a few options mentioned in the following blog which purport to delete several thousand files in seconds rather than hours:

  36. TelV said on July 18, 2017 at 4:07 pm

    How strange! I tend to maintain the last three versions of system image which are usually about 45GB each. I delete the oldest one before creating a new one each month, but apart from the prompt informing me that I need Admin permission to delete it, the actual deletion process takes less than ten seconds.

    Maybe it’s because each image is stored on an external drive (platter type) which makes the difference.

    1. amplak said on July 18, 2017 at 4:19 pm

      System image is often single file:)

      1. Croatoan said on July 18, 2017 at 4:29 pm

        Yes. One file 45GB takes few seconds, 5000 files 1 GB a few minutes.

      2. dmacleo said on July 18, 2017 at 4:26 pm

        when you keep website backups locally you have tons (just the base program itself like wordpress or similar can have 5000) of small 1 to 2 kb php files, they each get deleted separately and take time.
        single iso/image files take seconds. I often delete 45gb bluray iso’s, takes little time. a 5gb website backup takes a LOT longer.

  37. chesscanoe said on July 18, 2017 at 2:45 pm

    Thanks for the useful article. I enjoy going back to 1985 DOS techniques to get something efficiently accomplished.

  38. Richard said on July 18, 2017 at 1:48 pm

    @Martin Thanks for this. Very useful.

    In order to simply the registry changes, I exported the registry entries as .reg file and it can be downloaded from here!Ajyoa3dZEps6hewDvvyvozOJPc8xkg and merged (AKA installed) on a computer.

    1. Ramon said on January 28, 2020 at 10:00 pm

      Gracias! Muy amable. Funciono perfectamente.

    2. Matrix said on July 19, 2017 at 6:14 pm

      Thanks man!!!

    3. Mikhoul said on July 18, 2017 at 8:22 pm


  39. CHEF-KOCH said on July 18, 2017 at 1:01 pm

    You can install ReFS on Desktops too but there is not much (noticeable) benefit using it, except that you get encryption problem.

    NTFS also gots in the 24 years several updates and I there are (like every protocol) some good and bad things, but deleting stuff isn’t that bad compared to others.

    1. HK-Rapper said on July 18, 2017 at 5:45 pm

      If the only improvement is max volume- and filesize then it was another dud. Sure I cannot deny they take care of NTFS, but purely out of lack of having a real alternative. EXT4 will continue to outperform any MS filesystem.

      It is just that I would like something new. If the issues discussed here are not at least partially caused by the underlying FS, what else?

      1. CHEF-KOCH said on July 19, 2017 at 3:04 am

        Dunno what you want to improve but you as end-user not really mess with the file system ….

        There is no magic which makes you OS 20% faster because different file system, MAC OS recently rolled back to the older file system because the new one made trouble.

      2. darkfader said on November 16, 2022 at 8:27 pm

        “There is no magic which makes you OS 20% faster because different file system”
        oh my, are you mistaken…

        There are massive performance differences (and stability, and reliability, and so on) between filesystems.

        i.e. increasing the NTFS journal size has at times brought quite the beautiful impact on performance.
        very small file performance between jfs2 and ext4 is… 1000s of times better.
        ext4 on md raid outperforms everything else on ssds with fgpa/asic based compute offload.
        while normal ext4 … does not.
        ReFS is usually slower, except when it isn’t (vm storage)

  40. CHEF-KOCH said on July 18, 2017 at 11:27 am

    del /f/s/q foldername > nul
    rmdir /s/q foldername

    fatest way … deleting ~30GB/1,000,000 files/15,000 folders: rmdir takes ~2.5 hours, del+rmdir takes ~53 minutes.

    1. HK-Rapper said on July 18, 2017 at 12:51 pm

      I wish we could finally move away from NTFS after 24 years and embrace something new. Whatever happened to the intention to allow ReFS(Protogon) on Desktops than just servers.

  41. Thorky said on July 18, 2017 at 11:05 am

    Great! Thank you! :)

  42. Jeff said on July 18, 2017 at 10:26 am

    Try deleting using PerigeeCopy’s Delete function? How fast is it?

    1. Lassi said on December 11, 2020 at 6:37 am

      perigeedelete doesn’t really seem all that great with many (hundreds of thousands) of files at all. the command line delete is super slow too if you have a (literally)million files.

      gah, it seems it would be faster to copy all the other files from a tb drive to somewhere and format the disk and copy the files back..

    2. None said on July 31, 2020 at 11:13 am

      Why not try it and report back.

Leave a Reply

Check the box to consent to your data being stored in line with the guidelines set out in our privacy policy

We love comments and welcome thoughtful and civilized discussion. Rudeness and personal attacks will not be tolerated. Please stay on-topic.
Please note that your comment may not appear immediately after you post it.