Sign in to follow this  
Followers 0
lijun0238

How to stop runwait

10 posts in this topic

How to stop runwait

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

How to stop runwait

How about killing the process that's running?

Auto3Lib: A library of over 1200 functions for AutoIt

Share this post


Link to post
Share on other sites

How about killing the process that's running?

yes

Share this post


Link to post
Share on other sites

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

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

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
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 *

Share this post


Link to post
Share on other sites

It was just an example. I figured if he can't crawl, teaching him to run is fairly futile. :whistle:


Auto3Lib: A library of over 1200 functions for AutoIt

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0