This question already has an answer here:

I want to make a relative link in Windows 7 to a path that contains a space character.

Making a relative link without a space in the path works as follows (explained here):

%windir%\system32\cmd.exe /c start .\somepath\myfile.xlsx

But in my case I have a space in the path:

%windir%\system32\cmd.exe /c start .\some path\myfile.xlsx

I know that normally you have to wrap your path with double quotes when creating shortcuts. This works well when having absolute links.

But the following solutions do not work in my case:

%windir%\system32\cmd.exe /c start ".\some path\myfile.xlsx"

%windir%\system32\cmd.exe /c "start .\some path\myfile.xlsx"

I also tried to use other quotes quotes (´,') with the above combinations but I did not succeed.

Do you know what I am missing here?

marked as duplicate by grawity, Dave M, Dave, bwDraco, Renan Feb 22 '13 at 16:00

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


It looks like the previous answer was erroneous. Try this:

%windir%\system32\cmd.exe /c start \D<Relative path in double quotes> <Name of file>

So for you it would be like,

%windir%\system32\cmd.exe /c start \D"some path" myfile.xlsx

Hope this helps.

  • Thanks for your suggestions. When I use %windir%\system32\cmd.exe /c start "some path\myfile.xlsx"on my machine it only starts a new cmd.exe window and sets the "some path\myfile.xlsx" as a label for the cmd.exe window. I cannot (or better do not want ;) to have absolute pathes because I have to copy the directory tree to another computer with different drive letters and prefix and it should still work there. – Severin Winkler Feb 22 '13 at 12:35
  • Severin Winkler, the first "" after start is taken to be a window name. Try interpolating an extra "" between start and "some path". – Phil Freihofner Mar 8 at 2:37

Not the answer you're looking for? Browse other questions tagged or ask your own question.