Quantcast
Channel: Visual C forum
Viewing all articles
Browse latest Browse all 15302

Executing popen command without opening windows command window

$
0
0

Hello Everyone,

I want to execute command line option using _popen function as shown below:

FILE *fpipe = NULL;
fpipe = _popen(cmd.c_str(),_T("r"));
if(fpipe != NULL)
{
while(fgets(buff,sizeof(buff),fpipe)!=NULL)
{
//Some operation 
}
_pclose(fpipe);
fpipe = NULL;
}

It execute succesfully and give me correct output.
When this command execute It also shows command window. 

I don't want command prompt to open when my code execute. So please suggest me way to resolve this problem.

Thanks in advance,
Nilesh


Viewing all articles
Browse latest Browse all 15302

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>