How to get result or output of ShellExecute?
Posted on 2004-10-21
I am writing a MFC program to control RCS (Revision Control System from GNU).
The path has been set correctly.
The command I use is this
::ShellExecute ( NULL, _T("open"), _T("ci"), _T("-x,v -t-\"Initial Revision\" c:\\abc.txt c:\\temp\\RCS\\abc.txt,v"), NULL, SW_SHOW );
This corresponds to the DOS command:
ci -x,v -t-"Initial Revision" c:\\abc.txt c:\\temp\\RCS\\abc.txt,v
This DOS command can be executed correctly.
The return value is 42.
The DOS window disappears very quickly, so I can't see the output of "ci" command.
The problem is when I executes this command from my MFC program, the file is not checked in. But I don't know what happened during command execution.
I also try to put "> c:\\result.txt" at the end of parameter, want to put output in a ASCII file. But the result.txt is not created at all.
So is there some solution to capture the output of command execution or let the DOS window stay even after command is done so I can see the output?