lbowes
lbowes

Reputation: 162

Do system(); commands work in exactly the same way as batch commands?

Basically, do all batch commands (normally executed in a batch file, or just typed in CMD) work within the system(); function? Are they the exact same processes, or is system(); based on the syntax of the CMD/batch commands?

Upvotes: 1

Views: 133

Answers (1)

Cheers and hth. - Alf
Cheers and hth. - Alf

Reputation: 145457

The answer to the question in the title,

Do system(); commands work in exactly the same way as batch commands?

is "no".

But then in the main question text you clarify that by "batch commands" you include commands typed in the command interpreter, which is much like system. So then the answer is "yes", for that unorthodox & pretty meaningless meaning of "batch commands".

Regarding the "no" answer, for the question in the title, batch commands (in the sense of batch commands) are blocking for invocations of GUI subsystems programs, while typed commands are not. Testing this now, I found that system with g++ and Visual C++, is blocking for GUI programs. But this is not guaranteed. There are also syntactical differences. In particular that concerns the use of %.

Upvotes: 3

Related Questions