Windows Explorer

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there any way to copy and paste (or export) the names
of all - or some - of the files in a Windows Explorer
directory to a text file?
 
For a command prompt (cmd.exe) you can do:

To copy all directories and files and info:
dir C:\directory>c:\file.txt

To copy only directory and file names:
dir /b C:\directory>c:\file.txt

To copy only directory names:
dir /b /a:d C:\directory>c:\file.txt

To copy only filenames:
dir /b /a:-d C:\directory>c:\file.txt

See dir /? for more info.

Ray at work
 
Use the "Dir" command from the Command Prompt (cmd.exe)
[Start]
Run
cmd.exe
[Enter]

Type dir/? and press [Enter] for an explanation of the command.
Type dir and press [Enter] to see the output on screen.
Adding >> outputfile.txt to the end of the command sends the output to a file instead of the screen.
If you only use one > symbol, the output will overwrite the contents of the named file (so be careful).
If you use two >> symbols the output will be added to the end of the named file.

Examples:

dir c:\ >> outputfile.txt
dir c:\foldername >> outputfile.txt
dir /b c:\ >> outputfile.txt
dir /b /s c:\ >> outputfile.txt
dir /d c:\ >> outputfile.txt
dir /l c:\ >> outputfile.txt
dir /w c:\ >> outputfile.txt
dir /x c:\ >> outputfile.txt

Austin M. Horst
 

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

Back
Top