Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 4th June 2002, 20:33   #1
mcollins
Junior Member
 
Join Date: Jun 2002
Location: wa
Posts: 4
Send a message via AIM to mcollins
Arrow CommandLine param with CreateShortCut

Hey here is the problem i am having. I am trying to create a shortcut that contains a command line parameter for the exe it points to. When i run this ....

CreateShortCut "$DESKTOP\Whatever.lnk" '"C:\Test.ext" /c "MyString"'

it creates the shortcut just fine except it switches the "/c" to "\c" and so link does not work correctly. Does anyone know why its switching the slashes on me and how i can fix this problem? I've also tried

CreateShortCut "$DESKTOP\Whatever.lnk" '"C:\Test.ext" '/c' "MyString"'

and that didnt work either. Any help you can offer would be appreciated.

Thnx,
Mark
mcollins is offline   Reply With Quote
Old 5th June 2002, 06:40   #2
Smile2Me
Guest
 
Posts: n/a
I guess MyString is also a parameter. Then you should put both parameters into 1 string, like this:
CreateShortCut "$DESKTOP\Whatever.lnk" "C:\Test.ext" "/c MyString"

-Hendri.
  Reply With Quote
Old 5th June 2002, 16:19   #3
mcollins
Junior Member
 
Join Date: Jun 2002
Location: wa
Posts: 4
Send a message via AIM to mcollins
'"C:\Test.exe" /c "MyString"' (which is what ive been using) is actually one string that is contained inside single quotes. i did it that way because in the target path of the link file there are parts of the string that need to be in double quotes. If you were to right click and look at the properties of the icon, this is what should be in the target path...
"C:\Test.exe" /c "MyString"
mcollins is offline   Reply With Quote
Old 5th June 2002, 17:13   #4
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,336
The problem is that the parameters should come in a seprate string.

Quote:
CreateShortCut link.lnk target.file [parameters] [icon.file] [icon_index_number] [start_options] [keyboard_shortcut]
This is because the Windows function that creates shortcuts also uses two strings. One for the program and the other for the parameters.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 5th June 2002, 17:29   #5
mcollins
Junior Member
 
Join Date: Jun 2002
Location: wa
Posts: 4
Send a message via AIM to mcollins
Thanks!

Hey thanks a lot man! Spliting up the string solved my problem. Guess i just wasnt comprehending the documentation.
mcollins is offline   Reply With Quote
Old 6th June 2002, 06:36   #6
Smile2Me
Guest
 
Posts: n/a
Thx KiCHiK for explaining again. My solution was correct but apparently not clear to everyone. I'll be more clear next time.

-Hendri.
  Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump