how to copy files without showing dos window

Posted by vinaym on Stack Overflow See other posts from Stack Overflow or by vinaym
Published on 2010-05-07T12:14:36Z Indexed on 2010/05/07 12:18 UTC
Read the original article Hit count: 159

Filed under:

I have the following code to copy files

sprintf(command, "copy /Y %s %s", sourceFile, targetFile);
system(command);

It works except for the dos window showing up which is very annoying.

I am trying to use CreateProcess() (with an #ifdef for WINNT), but not sure how to setup the command line for the same. Any other options for copying files in C (on windows) without showing dos window?

© Stack Overflow or respective owner

Related posts about c