Please help - analize batch results and reboot if required.
Posted: 21 Apr 2014 17:49
Hi there,
I'm trying to write a batch file that that will analise a set of results and reboot if a problem is found in the results.
To explain, I have a graphics driver that fails to load every now and then and would like the machine to auto reboot on a failure.
I've tried using task scheduler to reboot on a system event, but as the event occurs before task scheduler has booted, it does not see it.
I can execute a batch file on system startup to interogate the graphics driver, the part I'm struggling with is analising the results and rebooting if a problem is found.
The command I am using is: devcon status *VEN_DADA* which returns the following results:
PCI\VEN_DADA&DEV_0150&SUBSYS_1150DADA&REV_00\5&38C677BD&0&000038
Name: eyevis NPX-4800-DVI2-2
Driver is running.
PCI\VEN_DADA&DEV_0150&SUBSYS_1150DADA&REV_00\5&38C677BD&0&200038
Name: eyevis NPX-4800-DVI2-2
Driver is running.
PCI\VEN_DADA&DEV_0150&SUBSYS_1150DADA&REV_00\5&13AF8972&0&000028
Name: eyevis NPX-4800-DVI2-2
The device has the following problem: 37
PCI\VEN_DADA&DEV_0150&SUBSYS_1150DADA&REV_00\5&13AF8972&0&200028
Name: eyevis NPX-4800-DVI2-2
The device has the following problem: 37
PCI\VEN_DADA&DEV_0150&SUBSYS_1150DADA&REV_00\5&29635535&0&000048
Name: eyevis NPX-4800-DVI2-2
Driver is running.
PCI\VEN_DADA&DEV_0150&SUBSYS_1150DADA&REV_00\5&29635535&0&200048
Name: eyevis NPX-4800-DVI2-2
Driver is running.
6 matching device(s) found.
how can I analise these results and reboot the machine if the "problem" is found? (problem is highlighted in bold above)
I believe the FOR /F command would work but I can't figure it out.
I would really appreciate any help.
Kind Regards,
Dave
I'm trying to write a batch file that that will analise a set of results and reboot if a problem is found in the results.
To explain, I have a graphics driver that fails to load every now and then and would like the machine to auto reboot on a failure.
I've tried using task scheduler to reboot on a system event, but as the event occurs before task scheduler has booted, it does not see it.
I can execute a batch file on system startup to interogate the graphics driver, the part I'm struggling with is analising the results and rebooting if a problem is found.
The command I am using is: devcon status *VEN_DADA* which returns the following results:
PCI\VEN_DADA&DEV_0150&SUBSYS_1150DADA&REV_00\5&38C677BD&0&000038
Name: eyevis NPX-4800-DVI2-2
Driver is running.
PCI\VEN_DADA&DEV_0150&SUBSYS_1150DADA&REV_00\5&38C677BD&0&200038
Name: eyevis NPX-4800-DVI2-2
Driver is running.
PCI\VEN_DADA&DEV_0150&SUBSYS_1150DADA&REV_00\5&13AF8972&0&000028
Name: eyevis NPX-4800-DVI2-2
The device has the following problem: 37
PCI\VEN_DADA&DEV_0150&SUBSYS_1150DADA&REV_00\5&13AF8972&0&200028
Name: eyevis NPX-4800-DVI2-2
The device has the following problem: 37
PCI\VEN_DADA&DEV_0150&SUBSYS_1150DADA&REV_00\5&29635535&0&000048
Name: eyevis NPX-4800-DVI2-2
Driver is running.
PCI\VEN_DADA&DEV_0150&SUBSYS_1150DADA&REV_00\5&29635535&0&200048
Name: eyevis NPX-4800-DVI2-2
Driver is running.
6 matching device(s) found.
how can I analise these results and reboot the machine if the "problem" is found? (problem is highlighted in bold above)
I believe the FOR /F command would work but I can't figure it out.
I would really appreciate any help.
Kind Regards,
Dave