PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
copy the document folder on vista-VBForums
Results 1 to 5 of 5

Thread: copy the document folder on vista

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2007
    Posts
    44

    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

  2. #2
    Lively Member
    Join Date
    Jul 2008
    Posts
    107

    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

  3. #3

    Thread Starter
    Member
    Join Date
    Dec 2007
    Posts
    44

    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

  4. #4
    Fanatic Member
    Join Date
    Feb 2006
    Posts
    607

    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"

  5. #5
    New Member
    Join Date
    Oct 2008
    Posts
    2

    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:
    1. Try
    2.                     My.Computer.FileSystem.CopyDirectory(mydocsvista, dest, True)
    3.  
    4.                 Catch ex As Exception
    5.                     MsgBox(ex.Message)
    6.                 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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width