i have made a code in c++ i am using _popen() to execute wmic commands but this is causing cmd to pop up for a split second that i don't want i want to run it in background without popping anything like cmd not even for a split second
this is what i am doing to hide console but it doesn't stop cmd for appearing for a split second and i checked with process explorer that when i use wmic it opens cmd otherwise it runs fine for e.g i am able to write into a text file without any cmd console popping
i am posting my code below
What I have tried:
while (fgets(line2, 256, CommandResult2))
{
line8 = line2;
if ((offset = line8.find(search0, 0)) != string::npos)
{
line8.erase(0, 39);
// cout << line8 << endl;
line8.erase(line8.size() - 1);
Ipv4 = line8;
_pclose(CommandResult2);
// IPFile.close();
}
}