DIGIT-ARC read-only archive · snapshot: July 23, 2026

Make pc shutdown if internet is not working!!

6 posts · originally from https://geek.digit.in/community/threads/make-pc-shutdown-if-internet-is-not-working.76374/

hdsk.23
hdsk.23 Original post #1
Dec 22, 2007 at 8:43 PM
Hello everybody...

can anyone know any way which make the pc shutdown if internet is not working.......i want to implement it on my BSNL connection...
there can be some script related to ping command that if a website is not replying then pc gets shutdown!!!!!
zyberboy
Dec 22, 2007 at 10:37 PM
u can do it using autohotkey,but u will need to write the script
chk here *www.autohotkey.com/forum/topic14834.html&highlight=check+cheque+lan+connection
hdsk.23
hdsk.23 #3
Dec 23, 2007 at 7:48 AM
thanks of ton bro..
but which script i should use......no idea plz help....plzz post the correct script here!!!
zyberboy
Dec 23, 2007 at 11:15 AM
First download and install autohotkey frm here,
then copy this code to a note pad and save with .ahk extension( eg script.ahk)
if u want u can compile it to .exe
Code:
ConnectionTest:
sleep, 10000

If ConnectedToInternet()
{
gosub, ConnectionTest
}
Else
{
Shutdown,1
}

return

ConnectedToInternet(flag=0x40) {
Return DllCall("Wininet.dll\InternetGetConnectedState", "Str", flag,"Int",0)
}
This script once activated chks if there is net connection in every 10 seconds,u can change the timing by entering alternate values in this step
sleep, 10000 <------ time in milli seconds
hdsk.23
hdsk.23 #5
Dec 24, 2007 at 1:47 PM
thanks bro. lots of ton....
u really very helpful...
script is working absolutely fine!!!
zyberboy
Dec 24, 2007 at 9:48 PM
^nice to see that:)