Speedup help

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
mo
Junior Coder
Posts: 49
Joined: Thu Aug 21, 2003 11:02 pm

Speedup help

Post by mo » Fri Oct 29, 2004 4:32 pm

I have the following sorta generic script which seems to me to be slow and round-about (I believe this was done with much help from Bob for another case where there was a problem, but what is the reason I need to go through the command prompt? I don't seem to be able to just go directly to the program I want to open...shouldn't I be able to do that?)

Here's the script:



//Variables
//
//Let>WindowName=C:\WINNT\system32\cmd.exe*
CapsOff
//Let>SK_DELAY=2
Let>WW_TIMEOUT=2

// Run program and wait for it to be active
Change Directory>C:\WINNT\system32
Run Program>C:\WINNT\system32\cmd.exe
WaitWindowOpen>Command Prompt
Wait>0.02
Send>cd H:\My Documents\GO\manyfaces\
Wait>0.02
Press Enter
Wait>0.02
Send>H:
Wait>0.02
Press Enter
Wait>0.02
Send>mfgo.exe /V/H/B
Wait>0.02
Press Enter
WaitWindowOpen> The Many Faces of Go
Wait>0.02
MoveWindow>The Many Faces of Go,176,177
ResizeWindow>The Many Faces of Go,935,693
WaitWindowOpen>What do you want to do?
MoveWindow>What do you want to do?,536,336
ResizeWindow>What do you want to do?,215,374
Wait>0.02
MouseMove>628,449
Wait>0.02
LClick
WaitWindowOpen>New Game
MoveWindow>New Game,507,308
ResizeWindow>New Game,272,431
Wait>0.02
MouseMove>681,349
Wait>0.02
LClick
WaitWindowOpen>The Many Faces of Go - [Go1]
MoveWindow>The Many Faces of Go - [Go1],176,177
ResizeWindow>The Many Faces of Go - [Go1],935,693
SetFocus>C:\WINNT\system32\cmd.exe
Wait>0.02
Send>exit
Press Enter
Best Wishes!
mo

Lumumba

Post by Lumumba » Fri Oct 29, 2004 6:03 pm



CapsOff

Let>WindowName=C:\WINNT\system32\cmd.exe*
//Let>SK_DELAY=2
Let>WW_TIMEOUT=2

// Run program and wait for it to be active
Run Program>cmd.exe cd H:\My Documents\GO\manyfaces\mfgo.exe /V /H /B

WaitWindowOpen> The Many Faces of Go
MoveWindow>The Many Faces of Go,176,177
ResizeWindow>The Many Faces of Go,935,693

WaitWindowOpen>What do you want to do?
MoveWindow>What do you want to do?,536,336
ResizeWindow>What do you want to do?,215,374

MouseMove>628,449
LClick

WaitWindowOpen>New Game
MoveWindow>New Game,507,308
ResizeWindow>New Game,272,431

MouseMove>681,349
LClick

WaitWindowOpen>The Many Faces of Go - [Go1]
MoveWindow>The Many Faces of Go - [Go1],176,177
ResizeWindow>The Many Faces of Go - [Go1],935,693

SetFocus>%WindowName%
Send>exit
Press Enter
Please check if this reduced code is still working. Thx.

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 » Fri Oct 29, 2004 9:42 pm

I believe this was done with much help from Bob
Just to note, you must be referring to another Bob. Unless we were discussing some concepts in general, this script does not look the least bit familiar to me.

Thanks again to Lumumba for cleaning it up for you.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

mo
Junior Coder
Posts: 49
Joined: Thu Aug 21, 2003 11:02 pm

Post by mo » Fri Oct 29, 2004 9:55 pm

Hello, and thank you for this response which however did not work. I am using Windows 2000Pro sp4 and there is something about the Command Prompt that is strange on this system.

To run the program from the command prompt I do this:

C:\#>cd H:\My Documents\GO\manyfaces\
C:\#>H:
C:\#>mfgo.exe

This does not work:
C:\#>cd H:\My Documents\GO\manyfaces\mfgo.exe -- and to my eye, it shouldn't; but this doesn't work either:

C:\#>cd H:\My Documents\GO\manyfaces\ [ENTER]
mfgo.exe
Because the prompt returns to C:\#> after the initial 'cd'
One needs to enter the 'H:'
I don't understand this, but I think it is standard.

Even so, entering the first sequence above and running the script, it stalls out after bringing up the command prompt (no message) and the MS edit dialog--which requires three clicks to stop running.

I am still asking the question as to why I need to use the command prompt at all. Why can I not just go to the directory and click on the .exe?
Best Wishes!
mo

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 » Fri Oct 29, 2004 10:09 pm

I am not familiar with mfgo.exe, but:

This does not work?
Run Program>H:\My Documents\GO\manyfaces\mfgo.exe
Is this a DOS program? Then how about this?
Run Program>cmd.exe "H:\My Documents\GO\manyfaces\mfgo.exe"
I am confused by the need to enter H: after changing directories. After you do cd H:........, do a dir listing uisng "dir"....what do you get? Now type H:, and do "dir" again. Are they the same? Is it possible that you may need to make a batch file and define the working directory....

Hmmm, that sound good.....make a batch file and see if you can run that directly from the Explore tree. It that works, then call that batch file using Run Program>. If it doesn't work, try making a shortcut on the desktop to the batch file, and define the working directory. Now try running the batch file from the shortcut icon.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

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