Command window not taking further input

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
montanan
Junior Coder
Posts: 49
Joined: Mon Jul 09, 2007 3:44 pm
Location: San Jose, CA

Command window not taking further input

Post by montanan » Thu Sep 20, 2007 3:03 pm

I have a batch script that runs and then requires some input to move to the next step. The command window just sits open.

I have tried several things, but have not yet been able to get Macro Scheduler to focus on the *.cmd window and receive the text (using a send command followed by a press Enter) from the Macro so that the process continues.

I also searched the discussion boards but did not find a prior posting on this topic.

The script is...

Let>RP_WAIT=1
Let>RP_DISPLAYERROR=1
Run Program>C:\testbatch.bat
WaitWindowOpen>cmd.exe*

# Wait for it to gain focus.
SetFocus>cmd.exe*

# Send a single character to advance the batch process.
Send Character/Text>a

# Press Enter.
SetFocus>cmd.exe*
Press Enter

# Wait for the script to complete.
WaitWindowClosed>cmd.exe*

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Sep 20, 2007 3:14 pm

You have RP_WAIT=1. This causes the Run Program command to wait until the program it is running has terminated before the script continues. Therefore your script will stop until the batch file finishes.

That's not what you want. Remove the Let>RP_WAIT=1 line.

From the help file:

"By setting the RP_WAIT variable to 1 prior to issuing the Run Program command the script will wait until the program launched by Run Program has terminated before continuing. The default value of RP_WAIT is 0."
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

montanan
Junior Coder
Posts: 49
Joined: Mon Jul 09, 2007 3:44 pm
Location: San Jose, CA

Post by montanan » Thu Sep 20, 2007 11:14 pm

That worked.

Thank you!

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