Auto-restart a Program 30 min

mylikes786

Registered Member
Joined
Oct 31, 2013
Messages
81
Reaction score
7
I'm looking for a script who can realize this sequence.

  1. Close the Program every 30 minute;
  2. Wait 30 seconds;
  3. Relaunch the Program;
Can you help me manage this problem ? Thanks a lot !
 
Download autohotkey

copy code:
Loop
{
Run Notepad.exe,,, pid
WinWait ahk_pid %pid%
Sleep 1800
WinClose
Sleep 30
}


replace 'Notepad.exe' with your program. eg. 'C:\firefox.exe'
 
I want that it kill my application and then open it again. because sometime it not responding
Download autohotkey copy code: replace 'Notepad.exe' with your program. eg. 'C:\firefox.exe'
 
Yes that is what it does.

Loop
{
Run Notepad.exe,,, pid ;--> run program
WinWait ahk_pid %pid%
Sleep 1800 ;--> wait 30 minutes
WinClose ;--> close program
Sleep 30 ;--> wait 30 seconds
}

Loop ;--> repeat forever. After waiting 30 seconds it repeats the entire process.

edit:

what is your program?
 
Instead of creating a script that is constantly running...You could make a bat file or script that stops and starts your application and then schedule it in windows scheduler ...
 
I ran a script in firefox is there any way my firefox auto restart when it is not responding

because my firefox always not responding after every 20-30 min
 
Get WinAutomation and automate the task of killing firefox in the task manager (really easy) then use the scheduler to do this every 30min!
 
Back
Top