|
[Windows] Scheduled task on event but leave time between runs?I use one of my windows PC's to download, sometimes when it is under heavy load it loses the network connection, and can not connect to DNS, so I always see event 1014 in the logs.
The only way that I have found to restore the network connection when this happens is to reboot the PC, so I created a task that runs on Event 1014 to reboot the PC.
But sometimes event 1014 might occur because the DNS is actually unavailable or there are problems with the internet connection to my ISP. I don't want the PC constantly rebooting when this happens is there a way to schedule this task so that if it happens again to leave like 2 hours or something like that between runs? |
|
|
You could use task manager to trigger a script file that would check a last run log file before running the reboot function.
But there is probably an easier way. |
|
|
Script suggestion is correct. It can be easily done in PowerShell. Right before reboot output date/time to the file. Then each time script is triggered read date/time from that file and don't reboot unless at least 2 hours has passed. |
|
exocet_cmWriting Premium Member join:2003-03-23 Brooklyn, NY |
to activoice
What about a different approach and run a script that utilizes a PING command to determine connectivity? |
|