Re: Running Command line programs from VC++

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



> ITYM system(). It's also defined in <stdlib.h> if you're already
> including that.
>
> system() is appropriate if your program is a console program and you
> want the output to be visible to the user. If your program is a
> Windows program, a console window will pop up and disappear once the
> command is done.
>
> While system() is portable and often useful, you can have more control
> (hiding the console window, piping data to and from the program, etc.)
> using CreateProcess().

True, but system will execute a command like "RMDIR /S/Q dirname". That's
one function stilll missing from the shell API. It would be very useful if
ShFileOperation(FO_DELETE) did that. Not that I expect it to work soon;
FO_COPY doesn't create directories, FOF_SILENT only removes a few message
boxes (so a window handle is still needed), and it's error reporting is a user
filing a bug report complaining my application failed. (XP SP1)

Regards,
Michiel Salters
.



Relevant Pages