jerrooh Posted July 13, 2006 Share Posted July 13, 2006 I need/need help with a program that will kill a process every 60 minutes. Would appreciate all help, thanks Link to comment Share on other sites More sharing options...
Developers Jos Posted July 13, 2006 Developers Share Posted July 13, 2006 I need/need help with a program that will kill a process every 60 minutes. Would appreciate all help, thankswelcome to the forum...Open the helpfile and check:ProcessClose()sleep()while...wend 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 More sharing options...
jerrooh Posted July 13, 2006 Author Share Posted July 13, 2006 while 1 ProcessClose("process") sleep() wend this closed process down, but dont understand how u enter minutes in sleep() also this scripts keep going intill I exit it right? thanks for support and friendly welcome Link to comment Share on other sites More sharing options...
Developers Jos Posted July 13, 2006 Developers Share Posted July 13, 2006 while 1ProcessClose("process")sleep()wendthis closed process down, but dont understand how u enter minutes in sleep()also this scripts keep going intill I exit it right?thanks for support and friendly welcome Did you look in the Helpfile for the Sleep() command ?What does it say to specify? 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 More sharing options...
NELyon Posted July 13, 2006 Share Posted July 13, 2006 try this function i cooked up. it uses process close. Simple, but works (i think) Do like CloseEverySoOften("iexplorer.exe", 5000) This would close iexplorer.exe every 5 seconds (i think) Func CloseEverySoOften($program, $time) While 1 ProcessClose($program) sleep($time) WEnd Endfunc Link to comment Share on other sites More sharing options...
jerrooh Posted July 13, 2006 Author Share Posted July 13, 2006 "Sleep(5000) ;five seconds" So two hours would be 7200000? so this is correct? Func CloseEverySoOften(iexplorer.exe, 7200000) While 1 ProcessClose($program) sleep($time) WEnd Endfunc Link to comment Share on other sites More sharing options...
/dev/null Posted July 13, 2006 Share Posted July 13, 2006 try this function i cooked up. it uses process close. Simple, but works (i think) Do like CloseEverySoOften("iexplorer.exe", 5000) This would close iexplorer.exe every 5 seconds (i think) Func CloseEverySoOften($program, $time) While 1 ProcessClose($program) sleep($time) WEnd Endfunc just a remark: Your function will never return! So where is the point making those few commands a function?? 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 More sharing options...
The Kandie Man Posted July 13, 2006 Share Posted July 13, 2006 (edited) while 1 ProcessClose("iexplorer.exe") ;Sleep command takes time in milliseconds. 1 second = 1000 miliseconds ;therefore 1000 * 60 = 1 min and 1min * 60 = 1 hour sleep(1000 * 60 * 60);you can put a number in here or a math expression, the script will run fine either way wend Edited July 13, 2006 by The Kandie Man "So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire Link to comment Share on other sites More sharing options...
Briegel Posted July 14, 2006 Share Posted July 14, 2006 (edited) Try this and you're able to do other things with your script. $program = 'program.exe' ; set your programname AdlibEnable('_CloseProgram', 3600000) ; set timer as you want While 1 Sleep(100) ; do what you want ; ExitLoop when ever you want WEnd Func _CloseProgram() If ProcessExists($program) <> 0 Then ProcessClose($program) EndFunc Don't forget to contact helpfile. Edited July 14, 2006 by Briegel Link to comment Share on other sites More sharing options...
i542 Posted July 14, 2006 Share Posted July 14, 2006 "Sleep(5000) ;five seconds" So two hours would be 7200000? so this is correct? Func CloseEverySoOften(iexplorer.exe, 7200000) While 1 ProcessClose($program) sleep($time) WEnd Endfunc CloseProgramAndWait("iexplore.exe",6000000) ;one hour is 6000000 ms Func CloseProgramAndWait($name,$microseconds) While 1 ProcessClose($name) Sleep($microseconds) Wend EndFunc NOT TESTED i542 I can do signature me. Link to comment Share on other sites More sharing options...
Developers Jos Posted July 14, 2006 Developers Share Posted July 14, 2006 (edited) ;one hour is 6000000 ms 60*60*1000 = 6000000 ms Edited July 14, 2006 by JdeB 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 More sharing options...
i542 Posted July 15, 2006 Share Posted July 15, 2006 60*60*1000 = 6000000 msSome error in my calculate? I can do signature me. Link to comment Share on other sites More sharing options...
Developers Jos Posted July 15, 2006 Developers Share Posted July 15, 2006 Some error in my calculate?yes..... 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 More sharing options...
PsaltyDS Posted July 15, 2006 Share Posted July 15, 2006 Some error in my calculate? MsgBox(64, "Math", "60*60*1000 = " & 60*60*1000 & " ms") Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
i542 Posted July 15, 2006 Share Posted July 15, 2006 3660000 ms? Sorry for my stupid error. i542 I can do signature me. Link to comment Share on other sites More sharing options...
Developers Jos Posted July 15, 2006 Developers Share Posted July 15, 2006 3660000 ms? Sorry for my stupid error.i542Getting closer ... 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 More sharing options...
i542 Posted July 16, 2006 Share Posted July 16, 2006 (edited) 3600000? My Calculator can't run. Func _MsToSeconds($microseconds_EX) If StringIsDigit($microseconds_EX) = 0 Then Return 0 Else Return $microseconds_EX/1000 EndIf EndFunc i542 EDIT: Yeah... I can put it on scripts and scraps.... Edited July 16, 2006 by i542 I can do signature me. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now