I want to run a cmd program through my C app and be able to get input and send output to the cmd. can I do such a thing?
thanks.
I want to run a cmd program through my C app and be able to get input and send output to the cmd. can I do such a thing?
thanks.
The function you're looking for is system(cmd)
. You can run the command normal (output will be directly printed to the screen):
system("command.exe");
Or capture the output (stdout
) in a file:
system("command.exe > file.txt");