Archive: CreateShortCut changing a literal / to \


CreateShortCut changing a literal / to \
CreateShortCut "$SMPROGRAMS\BPQ32\Configure.lnk" "Explorer.exe e/,$INSTDIR" "" \
"${NSISDIR}\BPQ32\Icons\bpqicon.ico"

is generating:

C:\Explorer..exe e\,C:\Program Files\BPQ32

rather than the needed format:

C:\Explorer..exe e/,C:\Program Files\BPQ32

i.e., the e\ is converted to e/ which Explorer does not understand as a start parameter.

Help!


What if you put it in a var?

Stu


Stu I tried:

StrCopy $ForwardSlash "/"

And substituted $ForwardSlash for the / in CreateShortCut and the generated shortcut has had the forwardslash translated to a backslash.

So good idea..but it didn't work.

There must be a way to escape the /, which clearly has a special meaning, into a literal /.

I tried $\/ which I thought might do the trick, but no.


I just noticed what you are doing wrong. Arguments go in a separate parameter for CreateShortCut.

Stu


Your right....the parameters for the target file,Explorer.exe, should have been the third positional parameter.

Here is what works:
CreateShortCut "$SMPROGRAMS\BPQ32\BPQ32 Configure.lnk" \
Explorer.exe "/e,/select,$INSTDIR\BPQ32.cfg" "${NSISDIR}\BPQ32\Icons\bpqicon.ico"

This correctly generates a shortcut with the target:
C:\WINDOWS\Explorer.exe /e,/select,C:\Program Files\BPQ32\BPQ32.cfg