copying file NAMES only

G

Guest

how can i copy the filenames (NOT THE FILE ITSELF) of a group of files
contained in a given folder? Purpose is to have the filenames in an excel
spreadsheet to use as input variables in vb script.
 
M

Mark Dormer

In a command prompt, navigate to the directory you want to list and type

dir /b > c:\list.txt

This will copy the current directory to a file

or

dir /b /s > c:\list.txt

This will copy the current directory and subdirectories to a file

or from the root of a drive

dir /b /s > c:\wholedrive.txt

Will give you every file on the disk

Regards
Mark Dormer
 
L

Luke Robertson

you can also use the 'tree' command, to display it like Windows
Explorer does (but in ASCII format)
Then, if you output to a file (eg tree /f /a > files.txt) you can use
EDIT or Notepad to view the contents
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top