It can be said that I don't understand this aspect at all. I found this batch script for automatically shutting down when the network is disconnected from the Internet.
@echo off
:start
ping XXX.XXX.XXX.XXX
if errorlevel 1 goto end
goto start
:end
shutdown -s -t 600
exit
What I want to ask (for help) is whether it can be made more intelligent. For example, if the ping to XXX.XXX.XXX.XXX is successful, the next command, which is the shutdown command, will not be executed. If it is not successful, it must definitely shut down. The problem is here. I want to delay the shutdown for 30 minutes, that is, shutdown -s -t 1800. Within 30 minutes, if the ping to XXX.XXX.XXX.XXX is successful, cancel the shutdown command shutdown -a and then re-detect the IP. If it is possible, it would be better to detect multiple different IPs. I can't change it well (fooling around). I think it's difficult. Maybe there is no such batch script. That's probably the general meaning. If there are other methods, it's also okay. If it's not possible or there are some third tools or other methods, please teach me.
@echo off
:start
ping XXX.XXX.XXX.XXX
if errorlevel 1 goto end
goto start
:end
shutdown -s -t 600
exit
What I want to ask (for help) is whether it can be made more intelligent. For example, if the ping to XXX.XXX.XXX.XXX is successful, the next command, which is the shutdown command, will not be executed. If it is not successful, it must definitely shut down. The problem is here. I want to delay the shutdown for 30 minutes, that is, shutdown -s -t 1800. Within 30 minutes, if the ping to XXX.XXX.XXX.XXX is successful, cancel the shutdown command shutdown -a and then re-detect the IP. If it is possible, it would be better to detect multiple different IPs. I can't change it well (fooling around). I think it's difficult. Maybe there is no such batch script. That's probably the general meaning. If there are other methods, it's also okay. If it's not possible or there are some third tools or other methods, please teach me.

