Jump to content

Recommended Posts

Posted

I really need to create an autoIT script which would check if the program is launched/connected or not, if not windows would trigger restart.

Any ideas? Thanks.

Posted

I really need to create an autoIT script which would check if the program is launched/connected or not, if not windows would trigger restart.

Any ideas? Thanks.

Your question seems a bit vague, however the functions ProcessExists,Shutdown may be helpful to you, refer to the help file for usage.

Posted

Your question seems a bit vague, however the functions ProcessExists,Shutdown may be helpful to you, refer to the help file for usage.

What about the time? i would like to set 'x' time.. Like ~200 seconds program *TITLE* not exist then restart computer, how the code should look?
Posted

What about the time? i would like to set 'x' time.. Like ~200 seconds program *TITLE* not exist then restart computer, how the code should look?

; this program waits 10 seconds for the process myexe.exe to be started else it reboots
$IsStarted=ProcessWait("myexe.exe",10000)
If ($IsStarted==0) Then
    Shutdown(6)
EndIf
Posted

; this program waits 10 seconds for the process myexe.exe to be started else it reboots
$IsStarted=ProcessWait("myexe.exe",10000)
If ($IsStarted==0) Then
    Shutdown(6)
EndIf

Thanks, but i mean about title, example if firefox still not runing ~10 sec (still not opened) then restart it :x not process
Posted

Thanks, but i mean about title, example if firefox still not runing ~10 sec (still not opened) then restart it :x not process

Hmm firefox's process is firefox.exe, if u want to restart process, look at ProcessClose and ShellExecute

Posted

Hmm firefox's process is firefox.exe, if u want to restart process, look at ProcessClose and ShellExecute

I know :< But isn't that possible to make it by title? Example if the program: "Name - Signed on" not exist more than ~200 then do - restart computer.. Not the process :<
Posted

Thanks, but i mean about title, example if firefox still not runing ~10 sec (still not opened) then restart it :x not process

If however you are talking about window titles, a similar logic to the code above can be used, implementing WinWait instead of ProcessWait and ProcessClose and or ShellExecute instead of Shutdown

Posted

I know :< But isn't that possible to make it by title? Example if the program: "Name - Signed on" not exist more than ~200 then do - restart computer.. Not the process :<

See helpfile for the Shutdown function.

Posted (edited)

If however you are talking about window titles, a similar logic to the code above can be used, implementing WinWait instead of ProcessWait and ProcessClose and or ShellExecute instead of Shutdown

You mean that?

; this program waits 10 seconds for the process myexe.exe to be started else it reboots 
$IsStarted=ProcessWait("Sign On",10000) 
If ($IsStarted==0) Then     
   Shutdown(6) 
EndIf
Edited by Wolfshare
Posted

You mean that?

; this program waits 10 seconds for the process myexe.exe to be started else it reboots 
$IsStarted=ProcessWait("Sign On",10000) 
If ($IsStarted==0) Then     
   Shutdown(6) 
EndIf

ok, What is it that you want to do?

I understood from your question that you want to check (for some time) if some program is open and if it is not, restart windows. Am i right?

Posted

ok, What is it that you want to do?

I understood from your question that you want to check (for some time) if some program is open and if it is not, restart windows. Am i right?

Yep, that's right, because there sometimes that program has problems, so only computer restart would help :x So example if the program with *TITLE* not opened like ~200 sec then restart computer
Posted

Yep, that's right, because there sometimes that program has problems, so only computer restart would help :x So example if the program with *TITLE* not opened like ~200 sec then restart computer

$IsStarted = WinWait("AutoIT script to check if program is working in timeloops - AutoIt Forums - Mozilla Firefox","", 10000)
If ($IsStarted == 0) Then
    Shutdown(6)
EndIf
Posted (edited)

$IsStarted = WinWait("AutoIT script to check if program is working in timeloops - AutoIt Forums - Mozilla Firefox","", 10000)
If ($IsStarted == 0) Then
    Shutdown(6)
EndIf

Thanks, what do you recomend? add it to my main script or create another au3 script?

And btw it should restart, not ShutDown.

Edited by Wolfshare
Posted

Thanks, what do you recomend? add it to my main script or create another au3 script?

And btw it should restart, not ShutDown.

You're welcome, the code above would work fine either way, however it would be great if you took a leisurely glance at the helpfile to understand how it works.

Posted

Thanks, what do you recomend? add it to my main script or create another au3 script?

And btw it should restart, not ShutDown.

reboot is exactly what the below code does 6=2+4=reboot+force now you're just being lazy, Please look at the helpfile or at least try the code before posting about it

Shutdown(6)
Posted (edited)

You're welcome, the code above would work fine either way, however it would be great if you took a leisurely glance at the helpfile to understand how it works.

Great, working Edited by Wolfshare

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
×
×
  • Create New...