Jump to content

Run vs. RunWait when using WinMove


Recommended Posts

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?

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...