To delete a folder using command prompt of windows, follow this procedure.

  1. Open a command prompt (Press the windows icon key and R to open the run window). Type cmd and hit enter from the keyboard.
  2. On a command prompt, enter the following command and hit enter from the keyboard.

Syntax:

rmdir /s <complete path of folder suppose>

When your path contains spaces, then the path must be enclosed in quotation marks.

Example:

rmdir /s "C:\Users\karim\Desktop\My Dumps"

That's it.

How To Delete a Folder Using Command Prompt of Windows
Avatar

Karim Buzdar

About the Author: Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various web sites. He blogs at LinuxWays.

26 thoughts on “How To Delete a Folder Using Command Prompt of Windows

  • Avatar
    August 25, 2018 at 10:10 am
    Permalink

    Thanks ! It worked for me !

    Reply
  • Avatar
    September 4, 2018 at 9:04 pm
    Permalink

    100% spot-on – THNX

    Reply
  • Avatar
    November 22, 2018 at 10:43 pm
    Permalink

    C:\Users\Marcel2>cd ..\..\Program Files
    C:\Program Files>rmdir /s EqualizerAPO
    EqualizerAPO, Are you sure (Y/N)? y
    EqualizerAPO\EqualizerAPO.dll – Access is denied.
    EqualizerAPO\libfftw3f-3.dll – Access is denied.
    EqualizerAPO\libsndfile-1.dll – Access is denied.
    EqualizerAPO\msvcp120.dll – Access is denied.
    EqualizerAPO\msvcr120.dll – Access is denied.
    Access is denied.

    Reply
    • Avatar
      December 28, 2018 at 10:09 am
      Permalink

      Try running the command from a console with administrative privileges.

      Reply
    • Avatar
      August 18, 2019 at 6:30 pm
      Permalink

      open cmd as run as administrator

      Reply
    • Avatar
      August 25, 2020 at 5:35 am
      Permalink

      Right click and run command prompt as administrator

      Reply
  • Avatar
    December 28, 2018 at 12:52 am
    Permalink

    I followed your steps completely, yet I still get an error (“…” is in the place of sensitive information, my real name is the user, with a space in between):

    C:\WINDOWS\system32>rmdir /s C:\Users\…\AppData\Local\Discord
    C:\Users\…, Are you sure (Y/N)? Y
    The system cannot find the file specified.
    …\AppData\Local\Discord, Are you sure (Y/N)? Y
    The system cannot find the path specified.

    Reply
    • Avatar
      December 28, 2018 at 10:11 am
      Permalink

      Does the folder really exist in that path?

      Reply
  • Avatar
    January 16, 2019 at 4:11 am
    Permalink

    how to set it automatically, it will delete folder for more than 2 days

    Reply
  • Avatar
    February 25, 2019 at 10:47 pm
    Permalink

    C:\Program Files (x86)>rmdir /s Epic Games
    Epic, Are you sure (Y/N)? y
    The system cannot find the file specified.
    Games, Are you sure (Y/N)? y
    The system cannot find the file specified.

    Reply
    • Avatar
      February 27, 2019 at 11:58 am
      Permalink

      if you need to delete a folder that has spaces in the name then you need to encompass the full path in quotation marks “”, windows sees the space as a break in the command and thinks the next thing after it is another command, but by surrounding the full path in quotation marks “” it reads the full path within them, spaces included, so it should look like below

      rmdir /s “c:\Program Files\folder name”

      Reply
    • Avatar
      August 8, 2020 at 8:28 pm
      Permalink

      do c:\ first then run the command rmdir /s Epic Games
      It will look like c:\ rmdir /s Epic Games

      Reply
  • Avatar
    March 20, 2019 at 6:04 am
    Permalink

    rmdir /s /q
    The syntax of the command is incorrect.

    What am i doing wrong

    Reply
    • Avatar
      April 10, 2019 at 12:01 pm
      Permalink

      You have to specify the path of the folder that shall be deleted. Please see the tutorial above for examples.

      Reply
  • Avatar
    April 9, 2019 at 5:26 pm
    Permalink

    The process cannot access the file because it is being used by another process.

    Same it is not working for me. Windows 10

    Reply
    • Avatar
      April 10, 2019 at 11:59 am
      Permalink

      Stop the application that is using the file before you delete the file.

      Reply
  • Avatar
    April 24, 2019 at 10:38 pm
    Permalink

    I chose “run as admin” and entered the prompt,
    typed: rmdir /s E:\Lixo
    still access denied
    I’m trying to delete the “windows” folder from an old hd
    any tips?
    Cheers

    Reply
  • Avatar
    May 2, 2019 at 8:50 am
    Permalink

    Fail: cmd as admin, still “access denied”

    Reply
  • Avatar
    May 6, 2019 at 7:31 am
    Permalink

    Got same error saying access denied even after running the command with administrative privileges.

    Reply
  • Avatar
    September 21, 2019 at 7:42 pm
    Permalink

    Yeah ! This command is running easily .

    Reply
  • Avatar
    May 28, 2020 at 6:24 pm
    Permalink

    yes i did but not working

    Reply
  • Avatar
    June 22, 2020 at 2:13 am
    Permalink

    Thanks so much for your instructions. I had been to other sites, looking for instructions on how to delete a folder in the Command Prompt that I could not delete by right clicking and selecting delete. I kept getting “The system can not find the file specified.” or “The system can not find the path specified.” Your site was the only one which explained that you have to enclose the path in quotation marks, if there are any spaces. That was my problem. One of the folders in the path had a space in the title.

    Reply
  • Avatar
    June 22, 2020 at 11:00 pm
    Permalink

    I ran the program both with command prompt and as a system administrator but it did not work yet. access denied
    C:\Windows\system32>rmdir /s “C:\Users\USER\Downloads\messengerfordesktop-setup_0544956837.exe”
    C:\Users\USER\Downloads\messengerfordesktop-setup_0544956837.exe, Are you sure (Y/N)? Y
    Access is denied.

    Reply
  • Avatar
    June 23, 2020 at 7:54 am
    Permalink

    That example “My dumps”
    Thanks helped me flush my dump :v

    Reply
  • Avatar
    July 19, 2020 at 1:28 pm
    Permalink

    OMG! After searching for eons finding a way to delete some empty folders that apparently were an issue for windows I finally found your explanation on how to use this command in the CMD prompt!
    It worked! Hallelujah! This old lady finally now knows how to remove folders that are more headstrong then myself! Thank you!

    Reply
  • Avatar
    August 19, 2020 at 7:42 pm
    Permalink

    how to copy copy specific folder like
    c:\user\admin\desktop (i want to compeletely copy desktop file not thoose file which is inside the desktop)
    i use this cmd
    xcopy c:\user\admin\desktop e:\data
    (but not copy desktop. thoose file are coppied which is inside the desktop folder.)

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

*