English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I have a .txt list of over 1000 files in different locations on my pc. The list shows files in the format drive:\folder\filename
i would like to delete all the files in the list

2007-07-12 23:48:31 · 5 answers · asked by 80s BaTMaN 1 in Computers & Internet Other - Computers

I have a list of over 1000 files in different locations on my pc. The list shows files in the format drive:\folder\filename
i would like to delete all the files in the list. The list of files and their locations is a .txt list. It is the files on the list that i wish to delete from my hard drive not the .txt file or the contents of the .txt file

2007-07-13 00:11:05 · update #1

5 answers

You can use the "for" command in your batch file to read in each line of text from your list and delete the file.

Like this,

for /f %%i in (mylist.txt) do del "%%i"

====
"for /f" - the "/f" tells the "for" command to get its input from somewhere else.

"%%i" - is the variable that we'll be using in the commandline. Note, if you run this command from a command prompt, then only use a single "%" in the two places where we call the variable.

"in (mylist.txt)" - this is where we'll be getting the input to use. Replace "mylist.txt" with the name of your list file. If your batch file is in the same directory as your list file, then you don't need to enter the entire path to the list file.

"do del "%%i"" - this tells the "del" command to use the line of input as its argument.

I've included quotes around "%%i" in case you have any spaces in your path or filenames.

For example, "my program files\test.txt"
If we didn't use quotes, then the del command would look like,
del my programs files\test.txt
and we'd get an error, but if we use quotes, then it will properly look like

del "my program files\test.txt"

====
I hope this helped.

2007-07-15 23:15:55 · answer #1 · answered by Kevin 7 · 5 0

You could do the following:

Start and then Search for Files and Folders.

Enter: *.txt

as the search criteria.
When it has finished searching, Edit and Select All and press the Delete key.

2007-07-12 23:53:41 · answer #2 · answered by Anonymous · 0 0

Go to a dos prompt (Start, run, cmd).
Type cd drive:\folder\filename
Type del *.txt (that is del space *.txt)
Be careful that your dos prompt shows that you are on the proper drive NOT c:\winnt . . . (SMILE)
Good luck!

2007-07-12 23:55:26 · answer #3 · answered by Ghiagirl 4 · 0 0

ctrl + A then push delete

2007-07-12 23:52:31 · answer #4 · answered by Anonymous · 0 0

use dirpro
http://www.geocities.com/lhcsoft2004/trialDirPro.zip

2007-07-15 16:27:07 · answer #5 · answered by Anonymous · 0 0

fedest.com, questions and answers