-1

I'm now using OneDrive for work. This has caused me some problems with a specific command that I have pined. The OneDrive path now contains spaces dashes and an ampersand.

C:\Windows\System32\cmd.exe /c "START /b /D C:\Users\NJC\OneDrive - A&B Services, LLC\Documents\emacs-26.1\bin\runemacs.exe"

If I click on the pinned icon, I get:

Windows cannot find '-'. Make sire you typed the name correctly, and then try again.

So far I've tried various combinations of caret and char, adding ^" around the command path and a mix of other things but nothing works.

I can not rename the path and I do not have admin on this machine. So I am stuck with the path.

Any suggestion on fixing the quotes

1 Answer 1

0

Please try my updated answer:

C:\Windows\System32\cmd.exe /c START "" "\\?\C:\Users\NJC\OneDrive - A&B Services, LLC\Documents\emacs-26.1\bin\runemacs.exe" /b /d

Since Windows found a ampersand it thinks you want to execute more than 1 command, but if you use \\?\ in the beginning of the path it ignores path phrasing.

5
  • I tried your suggestion but it starts a new command shell. The problem here is that the "Start ..." is the command to pass to cmd.exe. That's why it's quoted. Nov 17, 2021 at 17:35
  • Please try the updated answer.... Nov 17, 2021 at 17:39
  • I tried the updated answer with no luck, Where did you find the information about the \?\ ? Nov 18, 2021 at 2:39
  • I tested the start command myself by including a "&" in the target and it worked for me, strange...I got it here: docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file Nov 18, 2021 at 6:26
  • I missed the "" it worked!! Oh for emacs move the /b before the command string. Otherwise it thinks it's an option for emacs. Nov 18, 2021 at 20:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .