小编Jak*_*e J的帖子

Batch delete all files and directories except specified file and directory

I'm trying to delete all files and directories in a specific directory using a bat file in said directory. I've seen this done on Linux without problem, but in Windows command environment it seems to be a chore.

Example: \temp\1.bat (keep) \temp\special folder (keep)

Inside \temp\ contains all the folders and files I want to delete except the 1.bat and the special folder.

I have tried recursive commands but they delete the directory, or they delete all the files and …

cmd batch-file

5
推荐指数
1
解决办法
8627
查看次数

标签 统计

batch-file ×1

cmd ×1