Archive: Creating Shortcuts with command line argument


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.


What do you mean 'it has quotes around it'?

Where/what?

-Stu


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.


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

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!


Try this:

CreateShortCut "Shortcut.lnk" "path\program.exe" "parameters"


That worked!

Thanks.