Hello,
Is there a way to accept a value into a script by running a .exe with a parameter?
How do we check if the parameter is empty?
---
*edit* So, after posting, my search skills somehow evolved to a point where I can actually find what I'm looking for.
I believe the answer is yes, there is a way:
Run>full-path-scriptname.exe /variable=value
This makes the variable name available to the script with the value assigned.
Run>full-path-scriptname.exe /variable=
This makes the variable name available to the script with a value of 'nothing', or 'empty'
If I'm wrong, please let me know. Otherwise, thanks for allowing me to demonstrate my blonde factor
command line parameters
Moderators: Dorian (MJT support), JRL
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: command line parameters
To see if the variable exists just use the Assigned function:
So if you call your macro with:
exename.exe /VarName=fred
Then VarName is set to "fred"
But if you call it with:
exename.exe
Then VarName is set to "DefaultValue".
So there's no need to do /VarName=
But you can if you like!
Code: Select all
Assigned>VarName,VarExists
If>VarExists=FALSE
Let>VarName=DefaultValue
Endif
exename.exe /VarName=fred
Then VarName is set to "fred"
But if you call it with:
exename.exe
Then VarName is set to "DefaultValue".
So there's no need to do /VarName=
But you can if you like!
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?