Archive: Problem with start menu shortcut


Problem with start menu shortcut
Please bear with me. I've looked through all existing threads and I've seen information regarding my problem, but so far nothing has helped me fix it.

In my script I am creating a start menu items that points to a batch file. I want to set the "working directory" for the batch file to a directory other than $INSTDIR.

From what I have read on these forums, you do that by calling SetOutPath (and specifying the directory you want to be the working directory) prior to calling CreateShortCut. I'm doing that, but it isn't working. Here is the relevant portion of my script:

Section -StartMenuItems

SetOutPath "$INSTDIR\scripts\"
CreateDirectory "$SMPROGRAMS\KAST"

CreateShortCut "$SMPROGRAMS\KAST\${SERVER_NAME}.lnk" "$INSTDIR\scripts\StartWatchdogServer.bat" "$INSTDIR\icons\watchdog.ico" "0"

SectionEnd

This creates the start menu group correctly, and creates the menu item, but the "Start In" (i.e., working directory) for the bat file is still $INSDIR

Does anyone have any ideas? This has been holding me up for a while.

Thanks in advance for your help.

-Kennedy


I think the problem comes from the batch file opening a console window.

Have you try changing the directory from the batch file (CD command) ?


The working directory is set by SetOutPath instruction. In your case should be "$INSTDIR\scripts\". If you want to point to a different working directory then change the above SetOutPath.


Thank you for your replies. It turns out that the SetOutPath command does work for what I need. I just misunderstood the syntax and was trying to use it a little differently than I thought I was.

Thanks again..

-Kennedy