Member Avatar for randomkid73

Hello, I have done some research and keep getting results to hide the console window. What I would like to do is to hide the output of a command. For example, I have a segment that renews the PC's IP connection, so I get a long stream of the new IP address, subnet mask, DNS, etc. I know you can output to a text file, is there some modification to this that just does not show this at all?

Thanks

Recommended Answers

All 4 Replies

just try this , if not worked reply back.

#include <windows.h> // hope you already did this 

ShowWindow( GetConsoleWindow(), SW_HIDE );

Same answer as in this thread that was posted within the past 9 hours.

Member Avatar for randomkid73

Same answer as in this thread that was posted within the past 9 hours.

I don't think that is what I am looking for, unless I am misunderstanding the rest of that post. I want to only hide a specific portion of a loop. For example: (general portion of code)

#include <iostream>
using namespace std;
int main() {
cout<<"Renewing internet connection\n";
system("ipconfig/renew"); //If you have a better way to do this, please share :-)

I specifically want to hide the output results of the ipconfig, skipping to the next input.

Never use system() on Windows (see MSDN, basic rule)
Use Network apis (IPH)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.