Click here to Skip to main content
15,898,035 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted
Comments
[no name] 15-Jul-13 7:23am    
It's so urgent you could not tag you question correctly or tell us what the error message was? I do not believe that your command line would work anyway.

1 solution

Im a bit rusty, but try something like this

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


(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'
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900