CopyExt is a small extension for Windows Explorer that adds to menu items to the context menu for all files and folders allowing you to copy the entire file path, or just the file name, to the clipboard. Once there you are free to paste it wherever you see fit. Below is a screenshot showing the two menu items that it adds along with the help text in the status bar (I normally have the status bar off in Vista but I turned it on to show this feature).

CopyExt working

Parts of the code are based on this awesome CodeProject article by Michael Dunn which taught me everything I now know about writing shell extensions.

Downloads

I’ve decided to release the source code to this extension so those who are interested may learn from it or improve the code. Feel free to submit any suggestions to me and I shall give you a mention. The project is released under the GPL and has been made with Visual Studio 2008.

Download Binaries (32bit)
Download Source (VS2008)

Installing/Uninstalling

I haven’t made an installer for this because it is just not worth the effort. Both can be achieved with a simple command entered into the Windows Command Prompt.

  1. Download CopyExt.zip
  2. Unzip into any directory of your choice. Although it should not harm your system, I strongly advise against just putting the three DLLs in your System32 (or whatever) directory. Make a sub-directory somewhere and put all three files in it.
  3. Open command prompt and cd to the directory into which you unzipped the files.
  4. Now enter the command as shown in the screenshot. This will install CopyExt as a full Explorer plug-in which will be loaded next time you use the context menu.

How to install CopyExt

If everything went OK you’ll be prompted with the following message box.

Success!

Now that CopyExt is installed (and you have right-clicked on a file at least once) you will not be able to remove any of the DLL files in the directory because they have been loaded by Explorer. Don’t panic! It is important that you follow these instructions to uninstall rather than just deleting the directory in safe mode or something stupid.

  1. Open a command prompt window at the directory you installed CopyExt into.
  2. Type the command shown in the screenshot.
    How to uninstall CopyExt
  3. If all went well you’ll see this message box.
    Successfully uninstalled CopyExt
  4. Now for the scary part. Well not really, if you’re one of those people who do everything properly: close all programs you’re running, log off, and log back on again. If, however, you’re like me and you hate closing programs read on.
  5. Open Task Manager and go to your Processes tab. Now kill all explorer.exe processes (you’ll normally only have one, but if you run folder windows in a separate process you may have two or more).
  6. Finally, select File -> New Task (Run…), type in explorer and press enter.

Known Issues

CopyExt does not work correctly on shortcuts (.LNK files). Both context menu items will appear but neither of them will do anything due to the way Explorer handles shortcuts internally. Rather than just passing the filepath as it does with every other type of file it passes the destination of the shortcut. I also can’t find how to detect if the file is a shortcut so that I can either deal with it, or just disable the menu items. If anyone has any information on this please feel free to inform me.

Explorer Crashed!

I haven’t managed to make CopyExt crash Explorer on my machine but that’s not to say it’s impossible. If my extension crashes Explorer just follow the steps above to uninstall it, but please tell me about it so I can attempt to fix it. I’m releasing the source code so if you fix it even better! I’ll mention you in the history because I’m nice like that.

Don’t panic if explorer terminates. Just Ctrl+Alt+Del and open Task Manager, now re-run explorer as shown in step 6 of the uninstall instructions. Naturally this will load my extension again which may be the source of the problem. You can run the Command Prompt by typing cmd into the run box then cd to change directory to wherever you installed CopyExt and follow the instructions to uninstall.

I have only tested this on 32bit Vista with Service Pack 1. I haven’t used any fancy features so it should happily run on XP and even Windows 2000. Please provide feedback if you run it on anything other than 32 Vista with success.

Change Log

26/08/2009 – Version 1.0

  • Initial release.