# How to Schedule Auto shutdown when internet get disconnected?



## Honey (Nov 17, 2017)

hi,
Is that possible to shutdown computer automatically when internet is disconnected or modem is turned off ? We also able to Set timer about 10 mins to shutdown, actually i dont have advanced ups, i will buy later, currently im using apc rs1100va it doesnt have auto shutdown feature, so is that possible to do that?


----------



## Jetster (Nov 17, 2017)

There is a wake on lan feture. It might go to sleep with no activity. Never tried. Also check task scheduler for shut down by time


----------



## Honey (Nov 18, 2017)

Jetster said:


> There is a wake on lan feture. It might go to sleep with no activity. Never tried. Also check task scheduler for shut down by time


Task scheduler looks like difficult thing, i will try it today.


----------



## P4-630 (Nov 18, 2017)

Honey said:


> Task scheduler looks like difficult thing, i will try it today.



Try this:
Windows Task Scheduler: Trigger an Event When Internet Connects/Disconnects
https://www.groovypost.com/howto/au...-on-internet-connect-network-connection-drop/


----------



## Honey (Nov 18, 2017)

P4-630 said:


> Try this:
> Windows Task Scheduler: Trigger an Event When Internet Connects/Disconnects
> https://www.groovypost.com/howto/au...-on-internet-connect-network-connection-drop/


thanks alot for effort, it would defenetly work but i got problem in one step,
when i set action to run a program, i select "shutdown" and nothing happens. how to shutdown ?


----------



## FordGT90Concept (Nov 18, 2017)

You could "run a program"
shutdown.exe -s -f -t 0 -c "Internet disconnected."

-s = shutdown
-f = force applications to close
-t 0 = don't wait to shutdown
-c = logged message for shutting down


It could be an issue with user rights.  You may need to run the task as an admin user providing the credentials to elevate to said user.


----------



## Honey (Nov 18, 2017)

FordGT90Concept said:


> You could "run a program"
> shutdown.exe -s -f -t 0 -c "Internet disconnected."
> 
> -s = shutdown
> ...


Omg thanks. 
i tried this now, when is happening, is when i restart pc it get shutdown always,
is there any way that we can tell the difference to pc about EHTERNET is unplugged btw Ethernet is plugged and internet is not working.
this event will create problem when theres internet problem but modem is working, a 1 second of interruption can shutdown whole PC, 
i just want this event work on when Electricity is turned off(MODEM is not connected with UPS)
so when electricity goes off my system gets turned off. not on internet problem.


----------



## FordGT90Concept (Nov 18, 2017)

Plug UPS into computer (serial or USB cable) and use the software for the UPS to power off system?


----------



## Honey (Nov 18, 2017)

FordGT90Concept said:


> Plug UPS into computer (serial or USB cable) and use the software for the UPS to power off system?


will buy it soon. cant right now.


----------



## Thefumigator (Nov 18, 2017)

Honey said:


> Omg thanks.
> i tried this now, when is happening, is when i restart pc it get shutdown always,
> is there any way that we can tell the difference to pc about EHTERNET is unplugged btw Ethernet is plugged and internet is not working.
> this event will create problem when theres internet problem but modem is working, a 1 second of interruption can shutdown whole PC,
> ...



I think I know what you mean, so what's happening is that the computer shutdowns when you turn it on, as it detects there's no internet (because system is booting)
I would try this:

shutdown -s -f -t 60 -c "Internet disconnected."

and 

shutdown /a

the first command will shutdown your computer after 60 seconds (-t 60)
the other command cancels the shutdown procedure, just program it when internet comes back


----------



## Honey (Nov 18, 2017)

Thefumigator said:


> I think I know what you mean, so what's happening is that the computer shutdowns when you turn it on, as it detects there's no internet (because system is booting)
> I would try this:
> 
> shutdown -s -f -t 60 -c "Internet disconnected."
> ...


omg thank you too, you both made my day, expert peoples in this forum. helped alot..
i also wish if theres are setting to abort the event internet gets back in few seconds,
this event even shutting down when internet goes and unplugged, on both.
wanted to run on only internet unplugged instead of intruption( traingle sign)

im currently trying to make another event of 30 second delay, with shutdown /a cmd and enabling the settings of "start only if the following network is available"

EDIT----------UPDATE
oh my god guess what it is working,
actually my main motive was to save power,
Suppose if i use UPS usb one,
if my Pc is mining, and suddenly power is lost,
what that UPS will do, is try to keep run until 2% and it will shutdown, no doubt it will save data but it will waste all 100% battery juice, and then you need to charge,
and second more bad thing,
if UPS got 0% and suddenly power came, you started pc and started mining again, and power goes off again Pc will sudden power loss, it is still not safe,
this method will save power and saving power is best method to save money, less electricity bill.


----------

