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

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

  • 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
    • Permalink

      Try running the command from a console with administrative privileges.

      Reply
  • 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
  • Permalink

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

    Reply
  • 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
    • 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
  • Permalink

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

    What am i doing wrong

    Reply
    • Permalink

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

      Reply
  • 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
    • Permalink

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

      Reply
  • 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
  • Permalink

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

    Reply

Leave a Reply

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

*

Ad #native_company# — #native_desc# #native_cta#