how to use flags

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
Tobias
Junior Coder
Posts: 22
Joined: Mon Jul 19, 2004 1:44 pm
Location: The Netherlands

how to use flags

Post by Tobias » Mon Oct 24, 2005 7:43 am

Hi,

I'm pretty sure my question is not so difficult to solve, but I cannot find the answer. So perhaps someone elese can.

I want to to run an executable with a flag, just like one would do on a commandline. For example: the dir command lists all files in a directory and the flag /p will show the listing page by page.

My question: How to use flags in a macro?

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

Post by support » Mon Oct 24, 2005 8:04 am

Hi,

In exactly the same way as you would normally. Just use the Run command:

Run>command /flag

If running DOS commands it is usually best to run the command processor:

Run>cmd.exe /c dir /p

In Windows95/98 replace cmd.exe with command.com

/c = Carries out the command specified by string and then terminates.
MJT Net Support
[email protected]

Tobias
Junior Coder
Posts: 22
Joined: Mon Jul 19, 2004 1:44 pm
Location: The Netherlands

Post by Tobias » Mon Oct 24, 2005 8:31 am

Got it.

Thanks for the quick response.

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

Post by support » Mon Oct 24, 2005 8:33 am

BTW if running dos commands you will usually want the script to wait until the command completes. To do this add the following prior to the Run command:

Let>RP_WAIT=1

e.g.

Let>RP_WAIT=1
Run>cmd.exe /c dir >> dirlist.txt
MJT Net Support
[email protected]

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