windowswindows-xpregedit

Copy as path in windows context menu


I'm trying to implement "Copy as path" option in windows context menu ,which copies current file or folder path to clip board instead of installing a software for this , i would like to implement it my self. Any suggestions?


Solution

  • You can add a link to the context menu by fiddling with the File Types dialog, or using the registry. In the registry, the path is HKEY_CLASSES_ROOT\*\shell. Add a key under that named "Copy as path", and a key under that named "command". Change command's default string value to "c:\your-program.exe %1", and when the user selects "Copy as path" it will run your executable with that path as the argument. Now your executable just needs to write the path passed in to it to the clipboard