Hi There!
I'm trying to copy all the txt files in a directory and move to another directory.
But I keep getting "System cannot locate file" error.
Here is my code:
I'm a bit new to C and trying to learn so any help would be appreciated.Code:#include <stdio.h> #include <stdlib.h> int main() { system("copy c:\\Documents and Settings\\my_user_name\\My Documents *.txt c:\\"); system("pause"); return 0; }
Also in this instance I would use my own user name for this code, but what if I didn't know the user name, could I pass a variable instead?
Something like this pseudo code'
Then pass it like this:Code:get(system user name from system) = %username;
Code:path\\to\\%username\\directory