Jei jūsų internetas veikia, jums to reikiasekti, kai turite ryšį ar ne, paprasčiausias būdas tai padaryti yra stebėti „WiFi“ simbolį sistemos dėkle „Windows 10“. Jei prarandate interneto ryšį, „WiFi“ simbolyje pasirodo geltonas šauktukas. Taip pat galite pritraukti svetainę. Jei negalite nepastebėti sistemos dėklo, o pinginėti jums atrodo nuobodu, naudodamiesi paprastu scenarijumi, „Windows 10“ galite nustatyti garso perspėjimo apie interneto ryšį signalus.
SPOILER ALERT: Slinkite žemyn ir žiūrėkite vaizdo įrašo vadovėlį šio straipsnio pabaigoje.
Įspėjimai dėl interneto ryšio
Šį scenarijų iš pradžių parašė „Superuser“„Fabby“ ir patobulintas VMMF. Scenarijus reikalauja, kad atsisiųstumėte nemokamą „Win32“ paslaugų programą, vadinamą GNU. Ištraukite jį ir ieškokite šiame aplanke, kuriame rasite EXE, vadinamą „Sleep.exe“.
UnxUtilsusrlocalwbin
Tai bus naudojama norint pridėti laukimo laiką tarp patikrinimų. Šis EXE turėtų būti tame pačiame aplanke, kuriame įrašote scenarijų. Jums nieko daugiau nereikia, todėl nedvejodami ištrinkite.
Atidarykite užrašų knygelę ir įklijuokite joje. Išsaugokite jį su CMD plėtiniu ir paleiskite failą. „Sound.vbs“ failą sukuria scenarijus, todėl nesijaudinkite.

@ECHO OFF :whileNoInternet set "host=8.8.8.8" ::check if internet is working PING -n 1 -w 5000 "%host%" | findstr /r /c:"[0-9] *ms" if %errorlevel% neq 0 ( ::the internet is not working keep cheking until it does echo No internet yet %TIME% GOTO whileNoInternet ) echo we gained internet ::the internet is working play internet ON song @echo off set "file=InternetON_GOGOGO.mp3" ( echo Set Sound = CreateObject("WMPlayer.OCX.7"^) echo Sound.URL = "%file%" echo Sound.Controls.play echo do while Sound.currentmedia.duration = 0 echo wscript.sleep 100 echo loop echo wscript.sleep (int(Sound.currentmedia.duration^)+1^)*1000) >sound.vbs start /min sound.vbs @ECHO OFF :whileInternet sleep.exe 5s ::check if internet is still working PING -n 1 -w 1000 "%host%" | findstr /r /c:"[0-9] *ms" if %errorlevel% == 0 ( ::the internet is still working keep cheking until it does not echo We have internet %TIME% GOTO whileInternet ) :: detect possible internet glitches (do not trust the first failure) echo internet glitch detected sleep.exe 10s PING -n 1 -w 1000 "%host%" | findstr /r /c:"[0-9] *ms" if %errorlevel% == 0 ( ::the internet is still working keep cheking until it does not echo We have internet %TIME% GOTO whileInternet ) :: if it failed twice in a row most likely internet is down echo we lost internet ::the internet is not working anymore, play internet OFF song @echo off set "file=InternetHasFallen.mp3" ( echo Set Sound = CreateObject("WMPlayer.OCX.7"^) echo Sound.URL = "%file%" echo Sound.Controls.play echo do while Sound.currentmedia.duration = 0 echo wscript.sleep 100 echo loop echo wscript.sleep (int(Sound.currentmedia.duration^)+1^)*1000) >sound.vbs start /min sound.vbs ::start monitoring if it comes back GOTO whileNoInternet
Tai viskas, ką jums reikia padaryti. Komandų eilutės langas liks atidarytas, tikrinant jūsų interneto ryšio būseną. Jei jis pasikeis, išgirsite išjungimo garsą.
Komentarai