batch job. howto write all directory paths on a computer to one text file. not just dir ... > textfile.txt?
Netiad
2007-04-23 18:54:18 UTC
batch job. howto write all directory paths on a computer to one text file. not just dir ... > textfile.txt I am looking for a code snip that will record all of the directories to one file. in the windows environment
Five answers:
Kevin
2007-04-25 16:32:35 UTC
From your other questions, I'm guessing that you want a full listing of all the sub-directories so that you use them in another search. If that's true, then you will want to get a "bare" listing of your directories - that's without all the extra information like the creation date, timestamp, etc. You will also want to make sure to _just_ get directories, and not filenames.
Here's how you do that,
dir \ /s /b /ad > textfile.txt
"\" = start from the root directory
"/s" = get all subdirectories
"/b" = bare information, just names
"/ad" = just get directories
Warren
2016-07-23 11:54:58 UTC
2
?
2016-10-03 15:34:33 UTC
to maintain it straight forward, i could advise to discover the archives that already comprise the text fabric in a given direction, then circulate them to a temp itemizing and execute the command you already understand on the relax archives (this could circumvent having the text fabric appended two times). very final step, return the archives from the temp dir to the unique dir.
?
2016-07-10 07:18:06 UTC
Take Surveys Get Paid : http://OnlineSurveys.uzaev.com/?SGcL
dave_h4
2007-04-23 19:14:03 UTC
use the /s flag :
cd \
dir /s * > file.txt
or in batch :
@ECHO OFF
dir /s "%*"* > file.txt
ⓘ
This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.