Copy Filenames to Clipboard Utility

Windows has no way to copy a list of filenames to the clipboard. A Microsoft Knowledge Base article suggests writing a small *.bat file that runs the DIR command, collects its output into a file, prints that file, then deletes it. This may be convenient some times, but it would be more useful to be able to select a list of files, and have the names of them put on the clipboard. Then you could paste them wherever you needed them.

So here's a utility to do that. You have to do a bit of work yourself - but not much - to install it. Here are the instructions:

  1. Download the executable. It's only 20KB, so it should take only seconds even if you're using dial-up access. Save it wherever you want it to reside on your system.
  2. Create a Shortcut in "Go To"
    1. Go to the "Send To" folder under your name in \Windows\Profiles in Windows Explorer (or maybe XP Home puts that directory under the Settings folder, I can't remember).
    2. Right-click in the right-hand pane, where the filenames are. Select "New|Shortcut".
    3. The "Create Shortcut" wizard will appear. On the first page, type in the path to the executable, or use the "Browse..." button to find it. Click ""Next".
    4. On the second page, type in a name for your new menu option. I used "File Names to Clipboard", but pick whatever will be meaningful to you. Click "Finish"

That's it, you've got it installed. Now select one or more files, right-click, and move your mouse pointer to "Send To". A submenu will appear which will include your new command. Choose that command, and a list of the files you've selected, sorted in ascending order, will be on the clipboard.

Warning:

This utility has one large problem: the way it's installed means that it's activated as a console command. That means that it's subject to the limitation on the length of a console command. If you select more than about 70 files (depending on the length of the full paths to the selected files) you'll get an error message and the program will never even start.

The way to get around that is simply to select fewer files. Selecting 70 files twice instead of 140 once is incovenient, but at least it works.

The ultimate solution to this is for me to rewrite the utility as a Shell Extension. I intend to do that, but it's not a straightforward process. So don't hold your breath.


Feel free to contact me with questions or comments.

Tim Slattery
MS MVP (Shell/user)