Kodi Community Forum
restart software - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: Windows (https://forum.kodi.tv/forumdisplay.php?fid=59)
+---- Thread: restart software (/showthread.php?tid=199960)



restart software - jasemilly - 2014-07-15

Hi everyone

I am running Frodo on a win7 for a friend, who lives miles away and has no technical ability. I have set xbmc up for them and it's working great. It's left on all the time and it sometimes crashes when it hasn't been rebooted for sometime.

I know I can schedule a reboot of the machine but I would prefer not to do this as it does other jobs. But if XBMC itself could reboot at 2am everyday that would clear a little issue for me.

thanks
Jasemilly


RE: restart software - baijuxavior - 2014-07-15

It is possible to restart xbmc easily using the autohotkey script:

Code:
Process, Exist, xbmc.exe ; check to see if xbmc.exe is running
If (ErrorLevel > 0) ; If it is running
    WinClose, ahk_class XBMC ; close xbmc
Sleep, 10000 ; sleep 10 seconds
Run, C:\Program Files\XBMC\XBMC.exe ; start xbmc

Compile this script to create exe file and schedule it to run at the specified time in task scheduler.

A more fool proof method is

Code:
Process, Exist, xbmc.exe ; check if xbmc.exe is running
If (ErrorLevel > 0) ; If it is running
    WinClose, ahk_class XBMC ; close xbmc
Loop
{
    sleep, 1000 ; wait one second
    Process, Exist, xbmc.exe ; check if xbmc.exe is running
    If (ErrorLevel = 0) ; not running
        {
            Run, C:\Program Files\XBMC\XBMC.exe ; start xbmc
            Sleep, 2000
            WinActivate, ahk_class XBMC ; bring xbmc to the front.
        }
}