Folder - Delete from Command Prompt

Page 1 of 11 123 ... LastLast
    Folder - Delete from Command Prompt

    Folder - Delete from Command Prompt

    How to Delete a Folder in Windows from the Command Prompt
    Published by
    Designer Media Ltd


    How to Delete a Folder in Windows from the Command Prompt


       Information
    This will show you how to permanently delete a Folder in Vista, Windows 7, or Windows 8 using the RD or RMDIR command from within a command prompt.

    This can be handy if you cannot delete the folder using the normal methods.

       Note
    While you can run this command in a non-elevated or elevated command prompt, you would get the best results using a elevated command prompt.

       Warning
    The folder will be deleted immediately and not placed in the Recycle Bin first. Deleting a folder using this command will also delete all of it's contents as well as the folder. Be sure to backup anything you want to keep in the folder first.


    EXAMPLE: RD and RMDIR Command
    NOTE: You can use either the RD or RMDIR command in the command prompt. They are the same command.
    Folder - Delete from Command Prompt-about_rd_rmdir.jpg



    Here's How:
    1. Do step 2 or 3 below for where you would like to use a command prompt at.


    2. To Use a Elevated Command Prompt in Windows
    A) Open an Elevated command prompt in Vista/Windows 7 or Windows 8, and go to step 4 below.
    3. To Use a Command Prompt at Boot
    A) Open a command prompt at boot in Vista/Windows 7 or Windows 8, and go to step 4 below.

    B) In the command prompt, type diskpart and press Enter. (see screenshot below)

    C) In the command prompt, type list volume and press Enter. (see screenshot below)
    NOTE: This will let you see what the drive letter is for the drive that you want to delete the folder in since it may not always be the same drive letter that it is in Windows.

    D) After making note of the drive letter, type exit and press Enter. (see screenshot below)
    Folder - Delete from Command Prompt-command-1.jpg
    4. In the command prompt, type the command below and press enter.
    NOTE: Substitute Full Path of Folder within quotes below with your folder's full path within quotes instead.

    Code:
    RD /S /Q "Full Path of Folder"
    NOTE: For example, if I wanted to delete a folder named Folder on my desktop, I would type this command below.

    Code:
    RD /S /Q "C:\Users\UserName\Desktop\Folder"
    Folder - Delete from Command Prompt-elevated_command_prompt.jpg
    5. The folder should now be deleted.

    6. Close the command prompt.
    NOTE: If you used a command prompt at boot, then also close the System Recovery Options window and restart the computer.
    That's it,
    Shawn







  1. Posts : 846
    Windows 10 Pro
       #1

    Bringing back memories from 30 years ago.
    I thought everyone know that.

    DOS RULEZ!
      My Computer


  2. Posts : 71,975
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #2

    Hello Iggy (John ),

    Yeah, we've been having a few folks not being able to delete folders normally, so I thought this could help with that. DOS does rule. :)
      My Computer


  3. Posts : 93
    windows 7 ultimate was Vista home premium
       #3

    Thank you worked like a charm
      My Computer


  4. Posts : 10,200
    MS Windows 7 Ultimate SP1 64-bit
       #4

    Guess it's too much to suggest to them:
    rd /s /q %userprofile%\desktop\foldername
      My Computer


  5. Posts : 71,975
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #5

    Hello Karl,

    For only the C:\User\(user-name) location, that would be fine.

    I just used the normal full path version since it would be a better example for all situations. Plus, the %path% may not work so well if a command prompt at boot is used. That's all. :)
      My Computer


  6. Posts : 10,200
    MS Windows 7 Ultimate SP1 64-bit
       #6

    Hello Shawn,
    I agree.
    Karl
      My Computer


  7. Posts : 3
    windows 7 ultimate 64-bit
       #7

    great


    thanks dude.it work 100%
      My Computer


  8. Posts : 71,975
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #8

    You're most welcome Faridfaiz, and welcome to Seven Forums. :)
      My Computer


  9. Posts : 1,519
    El Capitan / Windows 10
       #9

    Brink said:
    Hello Iggy (John ),

    Yeah, we've been having a few folks not being able to delete folders normally, so I thought this could help with that. DOS does rule. :)
    Arrgh! It's not DOS!!! If I try anything with Int 21h Windows 7 will not only reprimand me but ship me off to Jersey as well...
      My Computer


 
Page 1 of 11 123 ... LastLast

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 01:33.
Find Us