หากอินเทอร์เน็ตของคุณแสดงขึ้นมาและคุณต้องติดตามเมื่อคุณมีการเชื่อมต่อหรือไม่วิธีที่ง่ายที่สุดในการติดตามสัญลักษณ์ WiFi ในซิสเต็มเทรย์ของ Windows 10 เมื่อคุณขาดการเชื่อมต่ออินเทอร์เน็ตเครื่องหมายอัศเจรีย์สีเหลืองจะปรากฏบนสัญลักษณ์ WiFi นอกจากนี้คุณยังสามารถ ping เว็บไซต์ หากคุณไม่สามารถจับตาดูซิสเต็มเทรย์และดูเหมือนว่าน่ารำคาญสำหรับคุณคุณสามารถตั้งค่าการแจ้งเตือนการเชื่อมต่ออินเทอร์เน็ตเสียงใน Windows 10 ด้วยสคริปต์ง่ายๆ
แจ้งเตือนสปอยเลอร์: เลื่อนลงและดูวิดีโอบทแนะนำท้ายบทความนี้
การแจ้งเตือนการเชื่อมต่ออินเทอร์เน็ต
ตอนแรกสคริปต์นี้เขียนโดย SuperuserFabby และปรับปรุงโดย VMMF สคริปต์ต้องการให้คุณดาวน์โหลดยูทิลิตีฟรีที่เรียกว่า GNU Utilities สำหรับ Win32 แยกมันออกมาและดูภายในโฟลเดอร์ต่อไปนี้เพื่อหา EXE ที่ชื่อว่า Sleep.exe
UnxUtilsusrlocalwbin
สิ่งนี้จะถูกใช้เพื่อเพิ่มเวลารอระหว่างการตรวจสอบ EXE นี้ควรอยู่ในโฟลเดอร์เดียวกับที่คุณบันทึกสคริปต์ไว้ คุณไม่ต้องการอะไรอีกแล้วอย่าลังเลที่จะลบมัน
เปิด Notepad และวางสิ่งต่อไปนี้ บันทึกด้วยนามสกุล CMD และเรียกใช้ไฟล์ สคริปต์สร้างไฟล์ sound.vbs ดังนั้นไม่ต้องกังวลกับมัน

@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
นั่นคือทั้งหมดที่คุณต้องทำ หน้าต่างพรอมต์คำสั่งจะยังคงเปิดอยู่ตรวจสอบสถานะการเชื่อมต่ออินเทอร์เน็ตของคุณ หากมีการเปลี่ยนแปลงคุณจะได้ยินเสียงปิด
ความคิดเห็น