I want to be able to run “netstat -n” and grab the output somehow so I can then write it out to another file.
How can I do this in C++ on Windows CE
Thankyou
Chris
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I solved this by essentially calling netstat from the cmd prompt, piping the output to a file, and then using it from there. I believe Kerido’s answer to be right but this is how I got it working.
This code then launches cmd.exe and telling it to run netstat -n. Note that the /c is required else cmd.exe will not launch the code