I want to do two steps in my c++ program using system().
However, it seems like when I run step2, the folder opened in step1 is already closed. What can I do to make sure that the folder won't be closed, so that I can use another cmd call to run .exe?
Thanks!
you can use
system("command1; command2; command3");
or
system("command1 && command2 && command3");
Refer To The following link: Using a Single system() Call to Execute Multiple Commands in C
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With