batch code to list the contents of a folder

April 16, 2011 at 20:44:27
Specs: Windows XP
I need a batch code to list the contents of a folder. Except I need it to exclude the files file1.bat, file3.bat, and file6.bat. I'm using the code "dir C:\ /B/S/A:-D>list.txt" and I get

file1.bat
file2.bat
file3.bat
file4.bat
file5.bat
file6.bat

but I want it to read

file2.bat
file4.bat
file5.bat

can I have some help.


See More: batch code to list the contents of a folder

Report •


#1
April 17, 2011 at 04:06:32
There's no exclude-list option in the dir command, nevertheless I think you can do an after batch trimming using search and replace in your .txt file for each occurences of your exclude-words.

By the way, I have a blog post about free virus protection, in case you are looking for one.


Report •

#2
April 17, 2011 at 17:57:33
robertm

Re your blog. If you have XP are you using "drop my rights"?

Please come back and let us know how you got on.


Report •

Related Solutions


Ask Question