Passing Parameter to Script

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
GlenHart
Newbie
Posts: 4
Joined: Sun Jan 23, 2005 4:03 pm

Passing Parameter to Script

Post by GlenHart » Sun Jan 23, 2005 4:07 pm

Hi,

I would like a Parameter to a script that I have written that runs as a NT Service.

I do not know if the MACRO_PARMS could be used here, in which case how do I get information into it?

Thanks

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Sun Jan 23, 2005 4:20 pm

From the HELP file:
When running a Macro from the command line in this way, you can also pass parameter values into the script :

msched Example Script /filename=testfile.txt /path=c:\outpath\

The above example runs a script called 'Example Script' and passes two variable values in filename and path. These variables can be used in the usual way within the script, e.g. :

Change Directory>path
ifFileExists>filename,ok
Goto>end
Label>ok
Message>File Exists !!
Label>end
As a general practice I now usually include full path and file extension for script names, so I would use
msched C:\MacroPath\Example Script.scp /filename=testfile.txt /path=c:\outpath\
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

GlenHart
Newbie
Posts: 4
Joined: Sun Jan 23, 2005 4:03 pm

Post by GlenHart » Sun Jan 23, 2005 4:40 pm

Thanks for this, but one further question.

How is it done with an .exe? Is it the same?

Thanks
Glen

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Sun Jan 23, 2005 8:32 pm

Yes.
MJT Net Support
[email protected]

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts