I recieved this from:
You could do something like this:
----- Start of code
@echo off
psloggedon -L -X %1 | findstr /L /C:"No one is logged on locally." > NUL
if ERRORLEVEL 1 goto NOTFOUND
shutgui.exe /L /R /C /T:00
goto :EOF
:NOTFOUND
REM ** Roll date foward one hour
set /A hour=1%time:~0,2% + 1 - 100
if /I %hour% GEQ 24 set hour=0
if /I %hour% LSS 10 set hour=0%hour%
at %hour%:%time:~3,2% "cmd /c restart.bat"
set hour=
----- End of code
PSLOGGEDON reports that nobody is logged on locally at task is scheduled in one hour to rerun the batch file again. In my example I named the above batch file RESTART.BAT.
Good Luck,
Steve
---------------
Please, anyone who has a need for this type of solution, give credit to Steve, a tech guru at experts-exchange.
The batch file does almost exactly what I was looking for, the only differance is that it is unable to watch for the logoff event. Therefore it schedules itself to check for a logged on user every hour untill the machine is available. It will then perform the reboot and remove itself from the scheduler.
Thanks for all the great suggestions everyone!