Bug in shortcut command

Jun 2, 2008
32
0
#1
Hi Rex

When I execute this command:

shortcut "F:\JPSoft\4nt.exe /c F:\eject.cmd" ... (see below for full command)

the target in the shortcut is set to (literally):

"F:\JPSoft\4nt.exe \c F:eject.cmd"

There are several things wrong here:

- The quotes enclose the whole command which makes Windows thoroughly confused when I double-click the shortcut.

- The forward slash on the "/c" option is changed to a backslash.

- The backslash in the path to eject.cmd is removed.

Full command (on one line):

shortcut "F:\JPSoft\4nt.exe /c F:\eject.cmd" "" "F:\" "Eject USB-key" "C:\Documents and Settings\c2441g1\Desktop\Eject USB-key.lnk" 2 "C:\WINDOWS\system32\SHELL32.dll" 26

Ebbe
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,504
46
Albuquerque, NM
prospero.unm.edu
#2
Hi Rex

When I execute this command:

shortcut "F:\JPSoft\4nt.exe /c F:\eject.cmd" ... (see below for full command)

the target in the shortcut is set to (literally):

"F:\JPSoft\4nt.exe \c F:eject.cmd"

Ebbe
Note that the filename to execute and its arguments constitute two separate arguments to the SHORTCUT command. You need to put each in double quotes:

Code:
shortcut "F:\JPSoft\4nt.exe" "/c F:\eject.cmd" "F:\" "Eject USB-key" "C:\Documents and Settings\c2441g1\Desktop\Eject USB-key.lnk" 2