I only need to start the service if it isn't running, do you know how to put the output string from "cmd /c at" into a variable so the status can be checked??

$value = " ??????????? "
if $value = "The service has not been started"
? "Starting Schedule service"
run "cmd /c net start schedule"
endif

run "cmd /c at /delete /yes"
run "cmd /c at 20:00 %windir%\shtdwn.exe /2"

Thanks
John Carr