Board logo

subject: How to Create a Context Menu Item to Copy a List of Files to the Clipboard in Windows 7 or Vista or XP [print this page]


How to Create a Context Menu Item to Copy a List of Files to the Clipboard in Windows 7 or Vista or XP

Have you ever needed to create a list of files in a directory? Here I will show you a trick--just need you right-click on or in any folder and copy a list of the files to the clipboard rather than use a command (really trouble) from the prompt to pipe the directory listing into a file. Now lets take a look at how to create a context menu item to copy a list of files to the clipboard Windows 7 or Vista or XP.

Using the Menu Item

Firstly, you can hold down Shift and right-click inside any folder (including the Desktop), and you'll see the new "Copy List to Clipboard" item.

Also you can hold down the shift key and right-click on a folder, where you'll also see the "Copy List to Clipboard" menu item as well:

You should have a list of files on the clipboard once you use the menu item.

You'll notice it's a simple file list, there's no file size or any other information displayed. You could modify the registry hack to eliminate the /b switch if you wanted to get the rest of the information.

How it Works

Actually here we are going to create a menu item that opens a command prompt, runs the dir /b command (for a clean directory listing), and pipes that into the clip.exe utility built into Windows 7 and Vista.

On the first step, we browse down to the following registry key:

HKEY_CLASSES_ROOTFoldershell

Now we created the copylist key, and then the command key underneath 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 could 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.

Note: If you are a Windows XP user, you can download clip.exe from Microsoft. Just save the file in the Windows directory and the rest of the hack should work for you.

Downloadable Registry Hack

Of course, if you think it is really trouble to add those keys manually, you can download, extract, and double-click on the CopyFileListClipboard.reg file to install. There's also a remove script included.

Welcome to http://www.newton360.com to get more information.

You can visit http://www.newton360.com/Detail/How-to-Create-a-Context-Menu-Item-to-Copy-a-List-of-Files-to-the-Clipboard-in-Windows-7-or-Vista-or-XP.html to read the original article.

You can get more Windows 7 tips, Windows 7 Wallpapers, Windows 7 Software from http://www.Newton360.com




welcome to loan (http://www.yloan.com/) Powered by Discuz! 5.5.0