También puedes redireccionar la salida del ping a un fichero .txt:
Código
For /L %X In (1,1,255) Do ping -n 1 192.168.1.%X >> ping_responses.txt
Para hacerlo desde C++ mira este ejemplo:
Código
#include <iostream> #include <string> #include <windows.h> using namespace std; static string host; static string ping_again; void ping() { system("cls"); cout << "Host: "; cin >> host; system (("ping " + host).c_str()); cout << endl; cout << "(Y)es or (N)o\n\n"; cout << "Ping another host: "; cin >> ping_again; if (ping_again == "Y" || ping_again == "y") { system("cls"); ping(); } else if (ping_again == "N" || ping_again == "n") { system("exit"); } } int main() { SetConsoleTitle("Ping in C++"); ping(); return(0); }
No es exactamente lo que tú quieres, pero te puede servir si lo ajustas.