Dec 7, 2015 at 3:14pm UTC
I am having issues with sending arguments to the command prompt using the system function to copy and paste a file. Here is my code:
system(" \"\"copy c:\\users\\william powell\\downloads\\rd.txt\" \"c:\\users\\william powell\\downloads\\setup files\" ");
This is the error message:
The filename,directory name or volume label syntax is incorrect.
cannot figure out what the issue is
thanks in advance.
Last edited on Dec 7, 2015 at 3:21pm UTC
Dec 7, 2015 at 9:16pm UTC
if you are on windows, you can use CopyFile function i think the name was
Dec 7, 2015 at 9:51pm UTC
I think you want to quote the file names, but not the "copy" command itself:
system("copy \"c:\\users\\william powell\\downloads\\rd.txt\" \"c:\\users\\william powell\\downloads\\setup files\" " );
Dec 9, 2015 at 11:33pm UTC
@dhayden that worked thanks but can you explain why does copy has to be outside the quotes