Jump to content

How to stop runwait


Recommended Posts

How to stop runwait

Hi,

maybe ablibEnable to check a time out and count it up, or using a Hotkey could help.

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

  • Developers

Or this way (is a bit saver...)

$pid = Run("NotePad.exe")
Sleep(3000)
If ProcessExists($pid) Then ProcessClose($PID)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Uh... Yes what? :whistle:

AdlibEnable("TimeOut", 3000)

RunWait("NotePad.exe")

Func TimeOut()
  $PID = ProcessExists("notepad.exe")
  If $PID Then ProcessClose($PID)
EndFunc
That will probably kill the wrong notepad process, if there are more instances of it. Better use WMI to get the process IDs of all notepad.exe and the corresponding parent process IDs. Then compare the AutoIT PID with the parent process id. Only if those match, you know you've found the right process. You need to check that only once in the Adlib function (implement it via a global flag). Then check if the Process exists for a specified amount of time. If necessary kill it, as you've shown above.

WMI Link:

http://www.autoitscript.com/forum/index.ph...st&p=256901

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

lijun0238, since you used the "Report" feature to notify the moderators about this thread, I can only assume you want it locked. And if your intention, like I suspect, is to draw attention to this thread, then you deserve to have your thread locked.

Click.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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