1
In C language, how do I copy the file gg.bat
for "%AppData%\Roaming\Microsoft\Windows\Start Menu\Programs\Startup"
I tried with
system("copy \"gg.bat\" \"%%appdata%%\\microsoft\\windows\\start menu\\programs\\startup\\\"");
But it is appearing:
The file name, directory name or label syntax volume is incorrect. 0 file(s) copied(s).
Don’t forget that the "" character is used as an escape prefix for several letters within a string (for example " n" turns into the Newline character code 10) - so always use two bars " in the file name.
– jsbueno
Other: Voce knows that with Sytem("copy") you are not "copying the file' in C, is not? The copy runs an external process that copies. A C copy would involve opening the original file for reading, the target file for writing, and reading the contents of one and writing to the other. But the final practical effect of the system("copy") is the same
– jsbueno