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