批处理脚本删除文件 [英] Batch script to delete files

查看:105
本文介绍了批处理脚本删除文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个批处理脚本如下:

I have a batch script as follows.

D:
del "D:\TEST\TEST1\Archive\*.TSV" 
del "D:\TEST\TEST1\Archive\*.TXT"
del "D:\TEST\TEST2\Archive\*.TSV" 
del "D:\TEST\TEST2\Archive\*.TXT"
del "D:\TEST\TEST 100%\Archive\*.TSV" 
del "D:\TEST\TEST 100%\Archive\*.TXT"

以上code删除所有来自所有文件夹名.txt和.tsv格式的文件,除了从文件夹测试100%。从测试100%删除文件我得到的误差路径找不到。我想在文件夹名称%符号产生的问题。
任何人都可以引导我解决这个问题,并从该文件夹 TEST删除文件100%

The above code deletes all the ".txt" and ".tsv" files from all the folders except from the folder TEST 100%. For deleting the files from TEST 100% i am getting the error as The Path could not be found. I guess the % symbol in the folder name creates the issue. Can anyone guide me to resolve the issue and to delete the files from the folder TEST 100%?

推荐答案

您需要与其他逃避%...

You need to escape the % with another...

del "D:\TEST\TEST 100%%\Archive*.TXT"

这篇关于批处理脚本删除文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆