To append stuff to an existing txt you use double >
dir /b >> C:\list.txt
use that instead of a single > and it always appends to the 'bottom' of the list.
Also, is it possible to use the /s switch but ONLY list subdirectories and their files? I want to capture 2 subdirectories of the same parent director into the same text file, but I don't want the other misc. files in the parent directory listed. Is this possible?
not possible, /s lists all files in all subdirs and such, to only get dirs and files in specific dirs you need to cd dir into them and then do either a /b or /s in that specific folder...
I've made a batch file to archive the things on my DVDs that i burn, it's two files, listed below... works great, however you need to read thru it and check the paths etc and customize to your needs :-p
First i run this batch file :
ECHO WELCOME TO THE DVD ARCHIVER V0.01
ECHO PLEASE TYPE ARCH %%1 %%2
ECHO WHERE %%1 REPRESENTS THE NAME OF THE DVD,
ECHO EXAMPLE: DVDX01X20031217
ECHO AND %%2 REPRESENTS THE DVD NUMBER,
ECHO EXAMLE: 001
ECHO EXAMPLE: ARCH DVDX01X20031217 001
ECHO TYPE EXIT TO EXIT.
and then from there i type ARCH, which runs this :
dir /b > D:\STUFF_DATA_DVD_ARCHIVE_\%2\%1_dirs.x
dir /s /b > D:\STUFF_DATA_DVD_ARCHIVE_\%2\%1_index.x
for /F %%x in (D:\STUFF_DATA_DVD_ARCHIVE_\%2\%1_dirs.x) do md "D:\STUFF_DATA_DVD_ARCHIVE_\%2\%%x"
for /F %%x in (D:\STUFF_DATA_DVD_ARCHIVE_\%2\%1_dirs.x) do md "D:\STUFF_OFFLINE_ARCHIVE_\%%x\%2"
dir /b > D:\STUFF_DATA_DVD_ARCHIVE_ emplist.x
ECHO. PLEASE INSERT THE NEXT DISK AND PERSS ENTER
from this i get
with a dirlist (empty actual dirs), and two txt files, one containing the dir /b list, and the other a dir /s list for complete dir listing, both dirs and files...
eh crap it makes little sense but try it :-p