Working with a compiled script with some passed in variables.
The following line works good directly from the command line:
C:\Path\CompiledScript.exe /Value1=string /Value2=1
----------------------------------------------
When called from a batch file, however, /Value1 and /Value2 are not passed.
C:\Path\Batchfile.bat /Value1=string /Value2=1
Batch file contents:
C:\Path\CompiledScript.exe %1 %2
----------------------------------------------
So I modified the batch file and the values /Value1 and /Value2 are passed. with this format
C:\Path\Batchfile.bat string 1
Batch file contents:
C:\Path\CompiledScript.exe /Value1=%1 Value2=%2
----------------------------------------------
I would really prefer to use the format of the first batch file that allows me to see the variable name with their values:
C:\Path\Batchfile.bat /Value1=string /Value2=1
but don't see why it is rejected.
Can anyone please provide an explanation?
Passing paramaters
Moderators: Dorian (MJT support), JRL
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Passing paramaters
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
As far as I am aware .bat files don't support /parmname=parmvalue and only expect each value referring to them as %1, %2 etc. That's just the way it is. Macro Scheduler works differently and expects /name=value pairs.
MJT Net Support
[email protected]
[email protected]
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Thanks adroege.
That looks like it may work, will try that tonight. Looking at the syntax it would seem that the command line is using "=" as a delimiter. I think I did try sending /Value1==string, but that did not work either. Will let you know the results.
That looks like it may work, will try that tonight. Looking at the syntax it would seem that the command line is using "=" as a delimiter. I think I did try sending /Value1==string, but that did not work either. Will let you know the results.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!