copy the document folder on vista
hi
on vista, I'm Trying to copy the document folder
My.Computer.FileSystem.CopyDirectory("C:\Users\yosi_lb\Documents", "D:\Documents")
the problem is that there are some folders inside the document folder like "My Music", "My Pictures", "My videos" that raise up exceptions. the error message is "Access to the path 'C:\Users\yosi_lb\Documents\My Music' is denied."
how can I bypass those folders ?
thanks
Re: copy the document folder on vista
It won't work if you aren't runnning it as administrator try logging into an admin account and see, also only check your own My documents
Re: copy the document folder on vista
I'm logged as administrator but still the problem exsist.
I tried to double click on the My Music folder but the system doesn't let me go in. I got a message box "...My Music is not accessible. access is denied".
how can i make my program to ignore those folders or what ever they are.
thanks
Re: copy the document folder on vista
Even logged in as administrator dosnt make you one in vista. They introduced the UAC for security.
I am assuming you have UAC turned on so you can try two options:
1) Disable UAC by going to your control panel
2) rightclick your program and click "run as administrator"
Re: copy the document folder on vista
ahh I found someone with the same problem. I currently have a thread open at
http://www.experts-exchange.com/Prog...html#a22675589
Sorry for posting in an old thread but I need this answer as well.
I do not currently have an answer but I know what the problem is.
Basically, there are the my music, my pictures, and my video folders hidden and unreadable within %userprofile%\Documents
These are called junction points and are inplace for when people upgrade from xp to vista. They cannot be read thus causing an access denied error when copying.
Here is the best I have come up with:
vb.net Code:
Try
My.Computer.FileSystem.CopyDirectory(mydocsvista, dest, True)
Catch ex As Exception
MsgBox(ex.Message)
End Try
Basically what this does is catch the error and reports it and then skips to the next part of the code. This isn't what we need to work. Basically, if we could just skip the file and not the whole directory that would be ideal. I provided this code to maybe help figure out how to skip the error.
If there is someway we can do do Copydirectory(source, dest, True, Ignore ex) I know that is not the right syntax but might help someone explain a way to do that.