Double quotes in Shortcut fields

User avatar
John Gray
PlatinumLounger
Posts: 5421
Joined: 24 Jan 2010, 08:33
Location: A cathedral city in England

Double quotes in Shortcut fields

Post by John Gray »

I'm having a Lot of Trouble trying to get the following to work in a Windows 7 Shortcut/Desktop Icon:

Target: "D:\Macrium Reflect backups\RunReflectFree.bat" "Reflect C drive backup.xml"
Start in: "D:\Macrium Reflect backups"

The problem lies in the double quotes.
The error message I get before the command prompt window disappears complains about
D:\Macrium
not being a valid program, and the like.

If I replace all the path blanks with underscores (obviously renaming the folder and XML file), and remove the double quotes, it works - but why can't I get it to run as shown above?
Do I need yet more double-quotes surrounding the Target field, perhaps?

Incidentally, the "Start in" field doesn't seem to put me in that disk and directory, but I can get round this by placing
CD /D "D:\Macrium Reflect backups"
within my BATch file.
John Gray

"(or one of the team)" - how your hospital appointment letter indicates that you won't be seeing the Consultant...

User avatar
HansV
Administrator
Posts: 78642
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Double quotes in Shortcut fields

Post by HansV »

Have you tried using the legacy short path? It doesn't need quotes.

As you undoubtedly know, you can see the short path by executing

dir D:\ /x

in a command prompt window.
Best wishes,
Hans

User avatar
John Gray
PlatinumLounger
Posts: 5421
Joined: 24 Jan 2010, 08:33
Location: A cathedral city in England

Re: Double quotes in Shortcut fields

Post by John Gray »

No, I haven't tried the short path - but it shouldn't be necessary!
As I said, I've changed the blanks in the paths to underscores, removed the double-quotes, and it works.

I still can't see why the original specification fails...

Later...
I've now found some Stuff about running as Administrator or User in StackOverflow, which I'll have to look at.
John Gray

"(or one of the team)" - how your hospital appointment letter indicates that you won't be seeing the Consultant...

User avatar
HansV
Administrator
Posts: 78642
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Double quotes in Shortcut fields

Post by HansV »

OK, but using the short path wouldn't require renaming the folder.

Interesting behaviour reported in the StackOverflow thread...
Best wishes,
Hans