maperr
8th August 2004 01:14 UTC
Creating Shortcuts with command line argument
Hi,
I'm trying to create a shortcut that calls javaw.exe. My script looks like this
CreateShortCut "$SMPROGRAMS\Pro-Coin\Pro-Coin (Startup).lnk" 'javaw -Dpro.coin.db=%PROCOIN_HOME%/data/procoin-db.prp -Djava.ext.dirs=%PROCOIN_HOME%/lib com.mwperry.procoin.ProCoin' "" "$INSTDIR\Pro-Coin.bat" 0
The shortcut is created ok, but it has quotes around it. This keeps it from executing. Is there a way I can remove the quotes? Or, should I be using some other function?
Thanks.
Afrow UK
8th August 2004 13:10 UTC
What do you mean 'it has quotes around it'?
Where/what?
-Stu
maperr
8th August 2004 15:26 UTC
After running this script, I go to the shortcut properties. The target value is
"javaw -Dpro.coin.db=%PROCOIN_HOME%/data/procoin-db.prp -Djava.ext.dirs=%PROCOIN_HOME%/lib com.mwperry.procoin.ProCoin"
When I try to execute, an error message pops up saying the specified target is not valid. If I remove the quotes the target executes fine.
Thanks.
Afrow UK
8th August 2004 15:32 UTC
Try:
CreateShortCut "$SMPROGRAMS\Pro-Coin\Pro-Coin (Startup).lnk" "javaw '-Dpro.coin.db=%PROCOIN_HOME%/data/procoin-db.prp -Djava.ext.dirs=%PROCOIN_HOME%/lib com.mwperry.procoin.ProCoin'" "" "$INSTDIR\Pro-Coin.bat" 0
-Stu
maperr
8th August 2004 15:46 UTC
That results in the target looking like
"javaw '-Dpro.coin.db=%PROCOIN_HOME%/data/procoin-db.prp -Djava.ext.dirs=%PROCOIN_HOME%/lib com.mwperry.procoin.ProCoin'"
which returns the same target error.
Another approach might be to give the absolute path to javaw and pass the rest as parameters. I know at install time the javaw can be found at $INSTDIR\jre\bin\javaw.exe
Do you have any idea how to pass these two command line parameters in a shortcut?
-Dpro.coin.db=%PROCOIN_HOME%/data/procoin-db.prp
-Djava.ext.dirs=%PROCOIN_HOME%/lib com.mwperry.procoin.ProCoin'
Thanks again!
pengyou
8th August 2004 16:05 UTC
Try this:
CreateShortCut "Shortcut.lnk" "path\program.exe" "parameters"
maperr
8th August 2004 16:12 UTC
That worked!
Thanks.