none
Override Unauthorized Access Exception RRS feed

  • Question

  • I wrote a small program to backup my user directory.

    It seems to work fine except when trying to copy the AppData directory. There it encounters an Unauthorized Access Exception.

    How can I overcome this? Thanks.

    Monday, October 23, 2017 4:47 PM

All replies

  • This can be tricky.

    See the following

    https://stackoverflow.com/questions/4526299/unauthorizedaccessexception-even-with-fullcontrol-for-everyone


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Monday, October 23, 2017 10:50 PM
    Moderator
  • http://www.thewindowsclub.com/activate-windows-super-administrator-account

    You can use the above admin account that has all the power and rights to run your program under the context of the admin account. You should use the account sparingly, and you should stay off the Internet  using the account. 

    Tuesday, October 24, 2017 12:25 AM
  • Hello jack0987,

    AppData directory contains some  Junctions like ApplicationData or others, Junction is a shortcut that redirects files and programs to a different location rather than a actual folder.

    you could go to the control panel and select folder options>view>show hidden files, folders and drives to find those junctions. The exception has thrown when you try to access those of AppData folder.

    There is a post that has the same problems with you and you could get more specific information from it.

    If you have any issues with above please feel free to contact me.

    Sincerely,

    Neil Hu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, October 24, 2017 7:57 AM
    Moderator
  • Hello jack0987,

    Is there anything updated?

    If you are satisfied with the reply, you could close the thread by marking as answer, This can be beneficial to other community members reading this thread.

    Sincerely,

    Neil Hu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Sunday, October 29, 2017 5:55 AM
    Moderator