Compartir a través de


A Windows Explorer Gem

I just tripped into this little gem and just couldn’t let this go without telling somebody, ‘cause I could have used this little feature 15 years ago!

Ever had to find a file on your machine with the only purpose to determine the absolute location to that file so that you could write some code that makes the path relative, etc., etc.?

Until today, I would typically find the file in Windows Explorer, then quickly hit Alt-D to put the focus in the address bar of the explorer window, which selects the full path to the directory of the file, like so:

image

Then I can easily Ctrl-C to copy, and away I go.

That works pretty well, but when I want the actual name of the file included in that path, I have to go paste the copied path, then type in the ‘\’, and then type in the name of the file ( assuming I could remember the name! ).

Well, no longer!

Hold the Shift key down while right-clicking on a file or directory. Go ahead, try it. Do you see anything different?

Here’s the context menu when I right click *without* holding the shift key over the mscorlib.dll file:

image

And here’s the context menu with the Shift key down while right-clicking:

image

Yes, “Copy as path”!!!!

Learn something new everyday….. Smile

Enjoy!

Cameron

Comments

  • Anonymous
    October 11, 2010
    The comment has been removed
  • Anonymous
    October 11, 2010
    Is there a gem like this that lists the directory contents to a text file, like old windows versions used to have a toolbar icon for?
  • Anonymous
    October 11, 2010
    I'm not aware of one, but clearly, that doesn't mean it doesn't exist! :)
  • Anonymous
    October 11, 2010
    The comment has been removed
  • Anonymous
    October 11, 2010
    That's great, but now I want to know how one can tweak the registry to get the "copy as path" command to be displayed without holding down the Shift key. Anyone?
  • Anonymous
    October 12, 2010
    I used to build pathes in xp in the start bar.  Missed it in win7 thanks
  • Anonymous
    October 13, 2010
    The comment has been removed
  • Anonymous
    October 13, 2010
    Usually I open the file in Notepad++ and use the CopyFilePath To Clipboard. I am still on XP, so this won't work for me.
  • Anonymous
    November 05, 2010
    This is awesome. I know I will be making use of that. The other one I use is if no items in the explorer window are selected is that I press Shift and then the context menu will have "Open command window here", which is also very useful.
  • Anonymous
    November 18, 2010
    Thanks, I didn't know about the alt-D
  • Anonymous
    November 20, 2010
    To copy a directory selext all files the use Copy As Path. As CopyAsPath is a shell extension rather than a static verb the shift key can't be disabled. However Open Command Prompt Here the shift key can be disabled by deleting the "Extended" named value from HKEY_CLASSES_ROOTDirectoryshellcmd
  • Anonymous
    January 17, 2011
    OMG! thanks, it's really helpful.:D
  • Anonymous
    February 16, 2011
    What about getting the absolute path on a network mapped path.  The copy as copies the mapped drive letter.