Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- :promptUser
- set /p choice="Do you want to check DNS (nslookup) or perform a continuous ping (ping)? (n/p): "
- if /i "%choice%"=="n" goto checkDNS
- if /i "%choice%"=="p" goto pingLoop
- echo Invalid option. Please enter 'n' for nslookup or 'p' for ping.
- timeout /t 2 /nobreak >nul
- goto promptUser
- :checkDNS
- echo Checking DNS...
- nslookup www.microsoft.com
- timeout /t 4 /nobreak >nul
- goto checkDNS
- :pingLoop
- echo Performing continuous ping to www.microsoft.com...
- :ping
- ping -n 2 www.microsoft.com
- timeout /t 4 /nobreak >nul
- goto ping
- pause >NUL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement