0

I can open cmd, system("commandprompt.exe"); but I have a follow up is to how I can get my code to open cmd but have it do ipconifg as I run the code.

  • 1
    `system("cmd.exe /C ipconfig");` but why wouldn't you just use `system("ipconfig.exe")` instead? Actually, you would need `popen()` or equivalent if you want your code to read the process' output (https://stackoverflow.com/questions/43116/). But then, it would be better to use an API that actually runs in your own code (ie, `getifaddrs()`, etc) instead of shelling out to an external process at all. – Remy Lebeau Oct 18 '22 at 00:00

0 Answers0