Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想使用批处理脚本从文件夹中删除所有 .txt 文件,以及其中包含的所有子文件夹。
我有一小段代码要从一个文件夹中删除,例如
del /s c:\MyFolder\*.txt
但是,这只会从“MyFolder”文件夹中删除文本文件。
尝试更换驱动器:
pushd C:\Myfolder if %errorlevel%==1 del /s *.txt popd
它正在所有子目录中搜索所有 .txt 文件!
莫娜