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