Sign in to follow this  
Followers 0
JATO

If ProcessExists not working - Newbie

6 posts in this topic

New to AutoIt v3 -- searched forum and couldn't find an answer

Just trying to check if a 3rd partyMSI file is running or not and pause the script 'til it's done..

I figure the easiest way is to check if MSIEXEC.exe is running ?? right?

so I used the ProcessExists function but AutoIt just stays paused forever.

How do I get it to check and then move on?

Here's my code....

If ProcessExists("msiexec.exe") = Then
 ProcessWaitClose("msiexec.exe")
Endif

Do I have the correct syntax?

suggestions?

JATO :P


~J. Schutzmanwww.alchemistgamer.com

Share this post


Link to post
Share on other sites



maybe this

While ProcessExists("msiexec.exe")
    ToolTip("msiexec.exe is running", 0, 0)
    Sleep(20)
WEnd

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

You can just do this:

ProcessWaitClose('msiexec.exe')

It will automatically continue if the process does not initially exist. However you can also do these:

If ProcessExists('msiexec.exe') Then
    ProcessWaitClose('msiexec.exe')
EndIf
If ProcessExists('msiexec.exe') Then ProcessWaitClose('msiexec.exe')

Share this post


Link to post
Share on other sites

that's a tricky one or just a missspell

If ProcessExists("msiexec.exe") = ? Then

ProcessWaitClose("msiexec.exe")

Endif

try a bool quiesten!!!

If ProcessExists("msiexec.exe") Then

ProcessWaitClose("msiexec.exe")

Endif

kjactive

Share this post


Link to post
Share on other sites

Maybe it's just Windows 2000 Adv. Server but the ProcessWaitClose ("msiexec.exe") wasn't working even though (in my opinion it would make sense .....that if MSIExec didn't exists at the time the command was called, the script should logically move on. -- So the script would pause indefinitely waiting for it to close when in fact it was never running in the first place.

SO...........

Finally used

If $msi = 0 Then 
   MsgBox(0, "MSI", "MSI is not running", 2);to test that IF statement woked 
   FileCopy("$Lic", "$path")

thanks for the help and I've learned a little about IF THEN statements


~J. Schutzmanwww.alchemistgamer.com

Share this post


Link to post
Share on other sites

we also like to help people that really try... like you

not just asking for "hand-outs"

8)


NEWHeader1.png

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