Jump to content

Recommended Posts

Posted (edited)

I am trying to get around using sleep()

I am running a psexec (which can execute commands on a remote machine) - problem is, i dont know when its done running the app.

in this particular case it's updating an application (bloomberg)

can any of you guys think of a creative way to figure out when a process is done running on a remote machine?

RunWait(@ComSpec & " /c c:\cg\support\psexec \\" & $asset & " -d -i c:\temp\upbb.exe /s")

Sleep(20000)

While FileExists("\\" & $asset & "\c$\temp\upbb.exe")
FileDelete("\\" & $asset & "\c$\temp\upbb.exe")
WEnd
Edited by gcue
Posted

@qcue...Did you try ShellExecuteWait() or you can just run the program and keep checking until the process doesnt exist using ProcessExists().

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
×
×
  • Create New...