1

We are using a proprietary application for inventory management and have discovered this application is unable to interpret spaces in file paths. For example:

C:\Google Drive\Invoices

Does not work, whereas

C:\Google\Invoices

does work.

Is there a special way to represent a space in Windows much like a URL string can use %20? For example C:\Google%20\Drive\Invoices.

phuclv
  • 37,963
  • 15
  • 156
  • 475
sammond
  • 113
  • 9

2 Answers2

3

Use 8.3 short name.

Try dir /x c:\

Google Drive should have a short name, probably like GOOGLE~1

Then you can use C:\GOOGLE~1\Invoices

cshu
  • 5,654
  • 28
  • 44
  • 2
    This works, unless generation of short names has been disabled. [Naming Files, Paths, and Namespaces](https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247.aspx): "*Note Not all file systems follow the tilde substitution convention, and systems can be configured to disable 8.3 alias generation even if they normally support it. Therefore, do not make the assumption that the 8.3 alias already exists on-disk.*" – Remy Lebeau Feb 12 '16 at 06:20
  • Worked perfectly! Thank you. – sammond Feb 15 '16 at 04:08
1

You can use short names if supported. Type dir /x and it's in the middle column.

short name dir

However it only works if short names aren't turned off. If short names aren't available the only way is making a junction point or a symbolic link1.

Run cmd as admin and type either of the following

mklink /J C:\ggdrive "C:\Google Drive"
mklink /D C:\ggdrive "C:\Google Drive"

This will create a link from ggdrive to the real Google Drive folder and now you can access Google Drive as ggdrive

However it's highly probable that you've used the path incorrectly. In some places you need to quote paths with spaces like this "C:\Google Drive\Invoices". But if an application in the last 15-20 years doesn't support long file names then it is rubbish anyway. Use a better program or report to the developer to fix it.


1 The differences between them is like this

phuclv
  • 37,963
  • 15
  • 156
  • 475