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!!!
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)
Please log in to answer
Posted by:
Jsaylor
14 years ago
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:
Keep in mind that your first letter can't be any of the reserved wisescript switches.
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
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
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.