Hi,

Does anyone know how to pass Commandline argument to Wise script?

I need to come up with Wisescript that takes the Servicename as argument.

Depending the service name that we pass as commandline, respective service will be stopped or started.

Your help would be highly appreciated!!!
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
You're looking for the CMDLINE variable. Anything that gets passed after the executable should be accessible through %CMDLINE% inside the wisescript. To use it, your script should look something like this:
Set Variable SWITCHES to %CMDLINE%

If SWITCHES equals "/ourcommand" then
execute command.exe
End


Keep in mind that your first letter can't be any of the reserved wisescript switches.
Answered 02/22/2010 by: Jsaylor
Second Degree Blue Belt

Please log in to comment
0
You're looking for the CMDLINE variable. Anything that gets passed after the executable should be accessible through %CMDLINE% inside the wisescript. To use it, your script should look something like this:
Set Variable SWITCHES to %CMDLINE%

If SWITCHES equals "/ourcommand" then
execute command.exe
End


Keep in mind that your first letter can't be any of the reserved wisescript switches.


Jsaylor beat me to it however one thing I did note while doing a quick test
If I run a command line such as:
Setup.exe /someservice /someservice2 /someservice3
The SWITCHES variable will be set with a string of “/someservice /someservice2 /someservice3” so if you wanted to pass multiple services you will need to split them later on.

Hope this helps

Cheers
Puds
Answered 02/22/2010 by: Pudsey
Senior Yellow Belt

Please log in to comment
0
Hi Jsaylor and Pudsey,

Thank you so much for your response. Much appreciated!!!

Regards,
WSPPackager.
Answered 02/23/2010 by: WSPPackager
Senior Purple Belt

Please log in to comment
Answer this question or Comment on this question for clarity