Jump to content

Wait 30 min, kill 2 processes


Recommended Posts

Need help with this. What command should I use for this?

The processes that I need to shutdown after 30 minutes is:

mspaint.exe

Game.exe

Then it'll wait ~5 minutes and will start mspaint.exe again.

I saw a "waiting code" yesterday, but can't find it now :/

Link to comment
Share on other sites

Need help with this. What command should I use for this?

The processes that I need to shutdown after 30 minutes is:

mspaint.exe

Game.exe

Then it'll wait ~5 minutes and will start mspaint.exe again.

I saw a "waiting code" yesterday, but can't find it now :/

Fixed close now. Just need starting (:

Link to comment
Share on other sites

Look up the following functions. I am surprised these weren't easy to find in the helpfile.

Sleep(), ProcessExists(), ProcessClose(), Run(), ShellExecute()

If you can't get it from there, then maybe you should try some of the tutorials that are stickied at the top of this forum.

I hope this helps boost your journey,

Jarvis

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

You could also use something like this

$Time = TimerInit()
$sApp_1 = "mspaint.exe"
$sApp_2 = "game.exe"
While TimerDiff($Time) < 180000
   Sleep(100)
Wend
If ProcessExists($sApp_1) Then ProcessClose($sApp_1)
If ProcessExists($sApp_2) Then ProcessClose($sApp_2)
$iRestart = @Min +5
If $iRestart >= 60 Then $iRestart -= 60
While 1
   Sleep(1000)
   If @Min = $iRestart Then ExitLoop
Wend
ShellExecute($sApp_1)

Edit: Syntax correction.

Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
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
 Share

  • Recently Browsing   0 members

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