Is it possible to use special characters to represent a space in Windows?

993 Views Asked by At

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.

2

There are 2 best solutions below

2
On BEST ANSWER

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

0
On

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