Jump to content

Need help with very simple autoit program


Recommended Posts

  • Developers

I need/need help with a program that will kill a process every 60 minutes.

Would appreciate all help, thanks

welcome to the forum...

Open the helpfile and check:

ProcessClose()

sleep()

while...wend

:D

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

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 :D

Link to comment
Share on other sites

  • Developers

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 :D

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

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

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 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

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. :D

Edited by Briegel
Link to comment
Share on other sites

"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

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...