/build/static/layout/Breadcrumb_cap_w.png

Passing Commandling Argument to WiseScript

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

Answers (3)

Posted by: Jsaylor 14 years ago
Second Degree Blue Belt
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.
Posted by: Pudsey 14 years ago
Senior Yellow Belt
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
Posted by: WSPPackager 14 years ago
Senior Purple Belt
0
Hi Jsaylor and Pudsey,

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

Regards,
WSPPackager.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ