如何删除多个文件 [英] how to delete multiple files

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

问题描述

嗨朋友们,

我有一个文件夹,我有100个文件,在100个文件中想要删除一些我在记事本中有列表的文件。我想使用命令提示符删除这些文件

例如



e:\> del foldernamefile1name.txtfile2name.txt file3.txt



当iam尝试显示错误时对我来说非常紧急....

感谢提前

Hi Friends,
I have one folder in that i have 100 files, in that 100 files in want to delete some files which i have a list in notepad. i want to delete those files using command prompt
eg

e:\>del foldername "file1name.txt" "file2name.txt" "file3.txt"

when iam trying it showing error its very urgent for me ....
THANKS IN ADVANCE

推荐答案

我有点生疏,但尝试这样的事情



Im a bit rusty, but try something like this

for /F "tokens=1" %%i in (list-of-files.txt) do del folder-name\%%i





(那应该是在一行上键入的内容btw)



其中list-of-files.txt是你要删除的文件列表,每行一个

文件夹名是实际要删除的文件的位置



(通常我会把它扩展得更好并把它放进去一个.cmd批处理文件)



如果你想测试它,用'echo'替换'del'你应该看到你要删除的列表< br $> b $ b

'g'



(thats supposed to be typed all on one line btw)

where list-of-files.txt is the list of files you wish to delete, one per line
folder-name is where the files to delete actually are

(usually I'd expand it out a bit better and put it in a .cmd batch file)

if you want to test it, replace the 'del' with 'echo' and you should see a list of what you would delete

'g'


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

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