Delete files or folder recursively on Windows CMD

后端 未结 12 1368
悲哀的现实
悲哀的现实 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:44

    Use the Windows rmdir command

    That is, rmdir /S /Q C:\Temp

    I'm also using the ones below for some years now, flawlessly.

    Check out other options with: forfiles /?

    Delete SQM/Telemetry in windows folder recursively

    forfiles /p %SYSTEMROOT%\system32\LogFiles /s /m *.* /d -1 /c "cmd /c del @file"
    

    Delete windows TMP files recursively

    forfiles /p %SYSTEMROOT%\Temp /s /m *.* /d -1 /c "cmd /c del @file"
    

    Delete user TEMP files and folders recursively

    forfiles /p %TMP% /s /m *.* /d -1 /c "cmd /c del @file"
    

提交回复
热议问题