#include<stdio.h>
#include<stdlib.h>
int main ()
{
int i;
printf ("\n");
i = system(" XCOPY [source path] [destination path] [options] ");
printf ("Returned value is: %d.\n",i);
return 0;
}
Copy files and/or directories to another folder. XCOPY is similar to the COPY
command except that it has additional switches to specify both the source and destination in detail.
options:
/s ----copy folders and subfolders
/u----copy files that already exists in the destination
/e----copy folders and subfolders including empty folders
/h----copy hidden folders and files
/a----copy files with the archive attribute set
/a----copy files with the archive attribute set
/D:mm-dd--yyyy ---- Copy files changed on or after the specified date.If no date is given, copy only files whose source date/time is newer than the destination time.
For more options goto
For more options goto
Do we have to leave the pre processor directives just like, #inlclude or do we have to add #include ??
ReplyDeleteI have updated the code check it now..
DeleteThanks for pointing out...we must have #include "stdlib.h" because we are using system function here...and #include "stdio.h" because we are using standard input output functions like printf().....
DeleteFor better understanding of system function() check out older post
It's just a editing mistake while highlighting the code.....