A lightweight Batch script to quickly verify the availability of multiple IP addresses or hostnames from a file.
- Operating System: Microsoft Windows
- Interpreter:
cmd.exe(Command Prompt) - A
.txtfile containing one IP address or hostname per line
- Multi-host availability check
- Supports both IP addresses and hostnames
- 2-second timeout per host
- Clean console output
- Automatic report generation (
hac_report.txt) - Progressive host counter
The script:
- Validates that an input file is provided
- Checks whether the file exists
- Reads each line (one host per line)
- Sends one
pingrequest (-n 1) with a 2000ms timeout (-w 2000) - Prints the result to the console
- Saves results into
hac_report.txt
This tool is ideal for:
- Network diagnostics
- Quick LAN/WAN reachability checks
- Basic server monitoring
- IT troubleshooting tasks
- Testing in LAN environments
hac/
├── hac.bat
├── hosts.txt
└── hac_report.txt (generated)
Create a file (e.g., hosts.txt)
8.8.8.8
google.com
192.168.1.1
Run the script
hac.bat hosts.txtConsole output
[1] Pinging 8.8.8.8 ...
REACHABLE
[2] Pinging google.com ...
REACHABLE
[3] Pinging 192.168.1.1 ...
UNREACHABLE
Generated report (hac_report.txt)
Ping results:
REACHABLE - 8.8.8.8
REACHABLE - google.com
UNREACHABLE - 192.168.1.1