Skip to content

Four different ways to copy a list of file names or folders

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.

  1. Select the file
  2. Press F2 or the Rename button
    1. Explorer will automatically select the file name but NOT the extension.
  1. If you want the whole file name with extension press Ctrl + A (Select All)
  2. Press Ctrl + C to copy the selection to the clipboard.
  3. 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.

Windows 11 for Microsoft Office users

Windows 10 for Microsoft Office users

About this author

Office-Watch.com

Office Watch is the independent source of Microsoft Office news, tips and help since 1996. Don't miss our famous free newsletter.