Sunday 26 January 2014

UNC Path Contains/Containing Spaces Doesn't Work

You are probably familiar with UNC paths such as \\servername21\departmentfolder\subfolder1\subfolder2\.

They are the best way to refer to network locations although many users prefer drive letters. Personally, I think that's lazy and it really takes zero brain effort to learn how UNC paths work. I find it differs greatly depending on the culture of the office how brain dead or smart the users are!

But what if your path contains a space e.g. \\LONFDB21\Marketing\Images\Stock Image 30123.jpg   ?

Then it often won't work. Windows will see a space as marking a separation and therefore the path will end at the "k" in "Stock". So if you need to send a UNC path to someone, you need to do one of the following:


  • double quotes around the UNC path
  • "<" and ">" around the UNC path
  • replace spaces with %20 (this seems to work better in browsers, I've found it unreliable elsewhere).
So above, I could use, for example:

<\\LONFDB21\Marketing\Images\Stock Image 30123.jpg>

or

"\\LONFDB21\Marketing\Images\Stock Image 30123.jpg"

You'll find that MS Office programs will also hyperlink correctly if you do it in this manner.

No comments:

Post a Comment

Popular Posts