Feb 212014

I know most of my important file locations by heart. Whenever I need to do things that require typing out a file’s full path, such as copying a backup or taking a peek at logs, I can type those paths from memory without issue.

On the other hand, when I’m working with systems I’m less familiar with or have never seen before, my memory can’t help me. At this point I’ve always opted for copying and pasting the paths of the file into SSMS or wherever else I might need it. This works just fine, but I’ve always been annoyed that the path and file name need to be selected and copied into the editor separately.

Two rounds of copy and paste seemed a little much. There has to be a better way, and in fact there is. This has probably been present in Windows for quite a while, but I found out about it just this week. I’ve long known that holding down the shift key while right-clicking on a file brings up extra options in the context menu, but what I didn’t realize is that one of those options is “copy as path”.

This will copy the full path of the file, including the name, to the clipboard, and you can now paste it wherever you like.

The Catch

The only downside to this is that, as you can see in the image above, the file path is surrounded in double quotes. This is great for pasting into a command prompt, but you’ll need to replace them with single quotes when working in SSMS.

UPDATE: Webucator has done a video demonstrating what I show in this post. You can see all the details here.

  13 Responses to “Copying and Pasting File Paths”

  1. This makes two of us who didn’t know that trick, thanks.

  2. This has got to be up there with Ctrl+Shift+t for resurrecting closed tabs. Thanks!

    PS – Like the redesign!

  3. Another tip to copy the full path and filename:
    Start typing a “\” after the path in the address bar. This will bring up a list of all files in the folder. You can filter this list by typing the start of the filename. You can copy the complete text when you have the entire path + filename in the addressbar. There will be no additional (double) quotes.

  4. Huh, would you look at that… This shall likely be the coolest thing I learn today!

  5. Wow. Yeah I never knew that! I’ll be saving myself a fair chunk of time now!!

  6. I’ve always used File Menu Tools at http://www.lopesoft.com/en/

    Not affiliated, don’t know them, don’t receive extra dark, slow roasted, espresso coffee beans as a kickback.

    Aside from the other 100 file and folder options (any of which you can disable with the configuration options if you don’t want/need them), you can get not only the file name and path, but you can get the UNC path, too.

  7. […] Copying and Pasting File Paths – Bob Pusateri (Blog|Twitter) […]

  8. Holy Guacamole! How did I not know about this? Thanks for sharing this tip. It’s all the little things that add up, be they good or bad. Glad to add this to the good list.

    • That’s pretty much how I felt when I first found out about it, Lance! Glad you found it helpful!!

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">