Hi all,
i've managed to include nbtstat in a program i'm working on, but there's something not working as it should.
When i run nbtstat from my program, it starts, but shows no output to my console app. Ofcourse it does show output from the cmd line.
I also tried writing the output to a text file, but the file is empty after running nbstat -A ip
This is how i use the function:
Any ideas ? Or maybe a different way to get the information i need without nbtstat but with a C++ function ?Code:void nbtstat() { string user_input, lookup_again; do { system("cls"); cout << "\nEnter URL or IP: "; cin.ignore(256,'\n'); getline(cin, user_input); user_input.erase(remove_if(user_input.begin(), user_input.end(), IsSpaceOrCR), user_input.end()); system("cls"); // Without the redirection to test.txt, the screen stays empty in the app. system(("C:\\Windows\\System32\\nbtstat.exe -A " + user_input + " > %TEMP%\\test.txt").c_str()); system("pause"); // Only for debugging purpose. cout << "Done." << endl; cout << "\nTry again?" << endl; cout << "\n(Y)es or (N)o: "; cin >> lookup_again; } while(lookup_again=="Y" || lookup_again=="Yes" || lookup_again=="y" || lookup_again=="yes"); }


Reply With Quote


Bookmarks