There are many ways to get a list of file names and folders, here’s four simple ways including one that might be a surprise.
Copy from Explorer
In Windows Explorer, select the files you want then right-click and choose “Copy as path” or Ctrl + Shift + C.
The list includes path. If you don’t want that, you can remove the path details in Word using the Alt key and a vertical selection like this.
Copy single file name
If you want just a single file name there are a few choices.
Use the ‘Copy as Path’ trick above after selecting a single file. Good if you want the whole folder path with file name.
For just the file name, try this … but carefully.
- Select the file
- Press
F2
or the Rename button- Explorer will automatically select the file name but NOT the extension.
- If you want the whole file name with extension press
Ctrl + A
(Select All) - Press
Ctrl + C
to copy the selection to the clipboard. - Press Enter or click away from the file to get out of rename mode.
Why carefully? An accidental key press after the Rename/F2 can change the name of the file.
Dir | Clip
This is one for those of us old enough to remember the Command Prompt (aka DOS Box).
For as long as there’s been DOS, you’ve been able to redirect output from one command to another using the pipe character | . For example DIR | SORT takes a file list (DIR) and send it to the SORT command to put in alphabetical order.
Knowing that, how about this … the CLIP option
DIR | CLIP
Takes a file/folder list and puts it into the Windows clipboard. From there you can paste it into any email, document or sheet you like.
Here’s the DIR output of a simple folder, pasted into Word.
Possibly more useful is just a list of file and folder names with
DIR /b
PowerShell has CLIP
Clip is also available in PowerShell where it can be combined the more powerful Get-ChildItem command.
Get-ChildItem -Name | clip
Produces a name sorted list of files/folders only and put it into the Windows clipboard.
More on CLIP command line tool
Use Clip /? to see details of the CLIP command. As you can see, it’s also possible to get the current clipboard contents and drop them into a text file.