copying file NAMES only

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
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
 
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
 
Back
Top