Jump to content

Recommended Posts

Posted

Guys i need to check if a specific process exist or not and wait until the process exist, I found ProcessWait() but seems like the parameter cannot be the PID and it works only with ProcessName.

Why i need this? I just used Run() to executed a program so i have the PID returned by Run() right? Now i need to wait until the PID exist. You know when you double click on some program maybe it take some time to run.

Some solution that i don't want: Using WinExist(), i don't want this because i'm going to run that program multiple times and i want to do something on each of them and maybe this program is allready running.

What i Exactly need: ProcessWait() with PID something like this:

$PID = Run("notepad.exe")
ProcessWait($PID)
MsgBox(64, "Notepad", "Now is running")

Any help is great.

Posted (edited)

Do this:

While ProcessExists($iPID) = 0
    Sleep(100)
WEnd

But like the help file said pointless waiting for a PID as if it's assigned a PID then it started successfully. Therefore check if the PID is greater than 0 or wait for a Window to exist if you're automating a Window screen.

Edited by guinness

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

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
  • Recently Browsing   0 members

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