Take the 2-minute tour ×

I've already read a lot about this and after several hours I still cant fix it. This is the fragment of the code that matters:

    void CopiarMover(string file) 
        File.Copy(@"C:\\Users\\Daniel\\Documents", "../../contenidos/" + file);

I've already configured my app manifest to:


And it keeps returning errors (permission denied). I'm using Win7. Any ideas on how to fix this?

share|improve this question
Are you sure that the 'access denied' refers to Documents folder? Could it be that it refers to 'contenidos'?. You are using relative paths. Relative to which folder? And why don't you use the backslashes in the destination path? –  Steve Jun 24 '12 at 14:12
Never use relative paths in your code. You cannot rely on Environment.CurrentDirectory being predictable and stable. –  Hans Passant Jun 24 '12 at 14:17

1 Answer 1

Any reason why you didn't specify the filename for the source?

Like this:

void CopiarMover(string file) 
    File.Copy(@"C:\\Users\\Daniel\\Documents\\" + file, "..\\..\\contenidos\\" + file);
share|improve this answer

Your Answer


