list of foler and filenames

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
berky93
Posts: 3
Joined: 13 Sep 2009 21:45

list of foler and filenames

#1 Post by berky93 » 13 Sep 2009 22:01

hello. I created a batch script that backs up certain folders and files. I want to add a command that will create a text file within the backup drive with a list of all folders and files within a specific folder in it. how would I go about doing this?

Example:

_________________________

| files.txt.....................[_][O][X]|
|--------------------------------------|
|folder1....................................|
|folder2....................................|
|folder3....................................|
|file1.........................................|
|file2.........................................|
|file3.........................................|
|file4.........................................|
|________________________|

(like my ASCII art?)

avery_larry
Expert
Posts: 391
Joined: 19 Mar 2009 08:47
Location: Iowa

#2 Post by avery_larry » 14 Sep 2009 11:02

dir /b /s "d:\parent folder">file.txt

berky93
Posts: 3
Joined: 13 Sep 2009 21:45

#3 Post by berky93 » 14 Sep 2009 18:35

I tried that command, and it created the text file, but it didn't put any text in it.

berky93
Posts: 3
Joined: 13 Sep 2009 21:45

#4 Post by berky93 » 14 Sep 2009 20:14

nevermind, I got it working...


wow, it showes everything huh?

avery_larry
Expert
Posts: 391
Joined: 19 Mar 2009 08:47
Location: Iowa

#5 Post by avery_larry » 15 Sep 2009 10:27

Everything you could ever want to know about dir:


http://ss64.com/nt/dir.html

Post Reply