avhimkov
3/18/2017 - 8:33 AM

alert.bat

@Echo Off
SetLocal EnableExtensions EnableDelayedExpansion

ping www.ya.ru
If !ErrorLevel! == 0 (
Echo Internet Online
) Else (
Echo Internet Offline
Echo rebooting modem..
rundll32 url.dll,FileProtocolHandler http://192.168.1.1/rebootinfo.cgi
)
var title = WScript.Arguments.Unnamed(0);
var wshshell = WScript.CreateObject("WScript.Shell");
wshshell.AppActivate(title);
@Echo Off
SetLocal EnableExtensions EnableDelayedExpansion
set window_title=Мой командник
title %window_title%

ping 11.0.0.13
If !ErrorLevel! == 0 (
Echo Internet Online
) Else (
errorlevel 1 cscript //nologo alert.js "%window_title%" & pause
)