Hello lovely people 🙂
We have already talked about the creating a context menu for copying text. In our today’s computer repairs blog we will discuss how to create a context menu item to copy a list of files.
We can actually do this with some registry user tricks and command line utilities. It is even possible for you to hide the menu item behind the Shift/Right Click menu as well. Pretty cool?
This is how you do it.
Step 1 – hold down Shift and right-click inside any folder, including the Desktop, and you’ll see the new “Copy List to Clipboard” item.
Or you can also hold down the shift key and right-click on a folder. This will let you see the “Copy List to Clipboard” menu item:
Now you will see a list of files on the clipboard, just like this one:
You willnotice it is a simple file list. It has no file size or any other information. If you want to get the rest of the information you could simply modify the registry hack to eliminate the /b switch
What we are actually doing here is making a menu item that will open a command prompt (I am sure this is familiar to all of you), run the dir /b command (for a clean directory listing), and then pipes that into the clip.exe utility built into Windows 7 and Vista.
First we browse down to the following registry key:
We create a copylist key, and then the command key beneath that. The default value for copylist is set to “Copy List to Clipboard”, and then we set the default key for command to our command line:
cmd /c dir “%1″ /b /a:-d /o:n | clip
You can use the same thing from a command prompt, or in your own scripts… just replace %1 with the directory you are trying to get a listing of.
For all the Windows XP users out there, you can download clip.exe from Microsoft. Just save the file in the Windows directory.
Hope this helps with your computer DIY and computer repairs efforts.
Over and out