Announcement

Collapse
No announcement yet.

How to delete folder & all it's content using command line

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to delete folder & all it's content using command line

    Hi all,

    I'm trying to delete this folder (c:\folder\test) & all his content with command line but it only delete all content inside the test folder. The test folder is still there. Is there any way to delete this folder and all of it's content using command line?

    C:\>del /f/s/q c:\folder\test
    Deleted file - c:\folder\test\New Text Document.txt
    Thanks

    Reference:
    http://www.microsoft.com/resources/d....mspx?mfr=true

  • #2
    Re: How to delete folder & all it's content using command line

    rd /s /q

    gerth
    gerth

    MCITP sa, ea & va, [email protected]

    Comment


    • #3
      Re: How to delete folder & all it's content using command line

      Originally posted by gerth View Post
      rd /s /q

      gerth
      Thanks gerth, forgot about that. Btw, the other command is rmdir

      Code:
      C:\>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
                  tree.
      
          /Q      Quiet mode, do not ask if ok to remove a directory tree with /S

      Comment

      Working...
      X