Delete files or folder recursively on windows cmd

How to delete files or folders recursively on windows from command line. I have found this solution where path we drive on command line and run this command. I have given example with .svn file extension folder

for /r %R in (.svn) do if exist %R (rd /s /q "%R")


Please execute the following steps:

  • Open the Command Prompt
  • Change directory to required path
  • Give following Command

    del /S *.svn


  • The other answers didn't work for me, but this did:

    del /s /q *.svn
    rmdir /s /q *.svn
    

    /q disables Yes/No prompting

    /s means delete the file(s) from all subdirectories.


    You can use this in the bat script:

    rd /s /q "c:folder a"
    

    Now, just change c:folder to your folder's location.

    链接地址: http://www.djcxy.com/p/16442.html

    上一篇: 如何在Windows XP中使用CMD utitilty删除文件夹?

    下一篇: 在Windows cmd上递归删除文件或文件夹