My goal is to have a batch script that checks windows services to see if they're running and output a .csv report. I also want this batch script to run hourly via Windows Task Scheduler.
Here is a script I was given to and am using for the example:
type null > servicecheckupreport.csv
sc query "AdobeARMservice" >> servicecheckupreport.csv
sc query "aspnet_state" >> servicecheckupreport.csv
sc query "AdobeFlashPlayerUpdateSvc" >> servicecheckupreport.csv
I am checking three (example) services, AdobeARMservice
, aspnet_state
and AdobeFlashPlayerUpdateSvc
.
The batch works fine when you manually execute it, however when I successfully connect it to Windows Task Scheduler using the "Create Basic Task" feature, the batch script runs, but doesn't generate the .csv report. I can see the command prompt come up for a little bit, goes away and then that's it.