Batch file. Delete all files and folders in a directory

前端 未结 14 1247
无人共我
无人共我 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:49
    IF EXIST "C:\Users\tbrollo\j2mewtk\2.5.2\appdb\RMS" (
        rmdir "C:\Users\tbrollo\j2mewtk\2.5.2\appdb\RMS" /s /q
    )
    

    This will delete everything from the folder (and the folder itself).

    0 讨论(0)
  • 2020-11-30 19:51

    Try the following; it works for me.

    I have an application which dumps data in my "C:\tmp" folder, and the following works the best for me. It doesn't even ask Yes or No to delete the data. I have made a schedule for it to run after every 5 minutes

    cd "C:\tmp"
    
    del *.* /Q
    
    0 讨论(0)
提交回复
热议问题