Sign in to follow this  
Followers 0
Scagnetti

Run vs. RunWait when using WinMove

2 posts in this topic

I've been working on a script that runs several batch files with the following criteria (if possible)

1) be able to view each individual CMD window as the batch file runs

2) be able to move the CMD window to a set location

3) run one batch file at a time

I started with the following:

Run($batch, "", @SW_HIDE)
Sleep(1000)
WinMove("[CLASS:ConsoleWindowClass]", "", $cmdx, $cmdy)
WinSetState("[CLASS:ConsoleWindowClass]", "", @SW_SHOW)
ProcessWaitClose("cmd.exe")

This works, but I've come across an issue where if there is secondary cmd.exe process running, it'll stop because of the ProcessWaitClose("cmd.exe")

I don't necessarily want to run taskkill to close any already-open cmd processes because this may cause some issues with those already running scripts.

The obvious solution here is to use RunWait, but I can't seem to find a way to use WinMove with RunWait - is this possible, or is there an alternate solution?

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0