Delete files or folder recursively on Windows CMD

后端 未结 12 1372
悲哀的现实
悲哀的现实 2020-12-02 08:30

How do I delete files or folders recursively on Windows from the command line?

I have found this solution where path we drive on the command line and run this comman

12条回答
  •  暖寄归人
    2020-12-02 08:50

    For file deletion, I wrote following simple batch file which deleted all .pdf's recursively:

    del /s /q "\\ad1pfrtg001\AppDev\ResultLogs\*.pdf"
    del /s /q "\\ad1pfrtg001\Project\AppData\*.pdf"
    

    Even for the local directory we can use it as:

    del /s /q "C:\Project\*.pdf"
    

    The same can be applied for directory deletion where we just need to change del with rmdir.

提交回复
热议问题