Batch file. Delete all files and folders in a directory

前端 未结 14 1333
无人共我
无人共我 2020-11-30 19:20

I want to have a batch file that will delete all the folders and files in my cache folder for my wireless toolkit.

Currently I have the following:

cd         


        
14条回答
  •  旧巷少年郎
    2020-11-30 19:28

    You can do this using del and the /S flag (to tell it to recurse all files from all subdirectories):

    del /S C:\Path\to\directory\*
    

    The RD command can also be used. Recursively delete quietly without a prompt:

    @RD /S /Q %VAR_PATH%
    

    Rmdir (rd)

提交回复
热议问题