Not to be a jerk but the following works without any high level programming....
Code:
Title BOINC Client Checker
@ECHO OFF
CLS
:Begin
Call C:\Program Files\BOINC\boinccmd.exe --get_state
IF ERRORLEVEL 0 GOTO SUCCESS
:RESTART
CLS
ECHO.
ECHO.
ECHO.
ECHO Restarting BOINC Client
START C:\Program Files\BOINC\boinc.exe --detach_console
Pause
Goto END
:SUCCESS
ECHO.
ECHO.
ECHO.
ECHO All is well
:Note. ThE Choice command only works with Vista/Windows 7. Delete the next line if not running Vista/Windows 7.
CHOICE /N /D Y /T 5
Goto END
:END
Instructions
1) Copy and paste the above code into notepad or your preferred text editor and save it as a .bat with any name you want. You can put it in any directory you think it will be safe. Maybe the BOINC program folder.
2) If you wish not to see the command window to pop up in the middle of your screen every time the batch files runs, then create a shortcut of the batch file in the same folder and right-click on it to edit its properties. Now look towards the bottom for the Run drop-down box and select minimized, now click the OK button to save.
3) To automate the batch file use the Windows Task Scheduler and create a new task.
Don't know how to use Task Scheduler?
Here is a nice primmer ---> http://www.thewindowsclub.com/schedu...task-scheduler
Here is a short YouTube video (Very Basic) ---> http://www.youtube.com/watch?v=8986eNlXjos
Here is another YouTube video (Detailed but long) ---> http://www.youtube.com/watch?v=Af6qgd4Yy4Q (Skip the first two and a half minutes)
Ready?
1) Start Task Scheduler and click create new task.
2) General Tab - enter something that you'll recognize in the name box, Like BOINC Client Checker, then click the radio button for "Run weather user is logged in or not" and then at the drop-down box Configure For: select Windows 7.
3) Next click the Triggers tab and then the New button. In the pop-up window do the following:
*Set begin the task to At startup
*Next under Advanced settings, check the box for Delay task for: and set for 30 minutes
*Then check the box for Repeat task every: and set it to whatever you think is good. 30 minutes will work.
*Click the OK button to close window
4) Now click the Actions tab and then the New button.
*In the pop-up window, the action box should be set to Start a program
*Click the Browse button and navigate to the batch file shortcut and select it.
*Click the OK button to close.
5) (Optional) Click the Conditions tab. Under the Power settings uncheck both boxes.
6) (Optional) Click the Settings tab
*Check the box for Run as soon as....
*Check the box for If task fails, restart every: and set to 5 minutes
7) Click the OK button, enter user password and click OK button to complete task setup. That's it, you are done!