Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7436787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:17:48+00:00 2026-05-29T10:17:48+00:00

The following code, running as administrator from local hard drive, using the .Net Framework

  • 0

The following code, running as administrator from local hard drive, using the .Net Framework 2.0, sometimes raises an UnauthorizedAccessException on the second line:

IO.File.SetAttributes(File, IO.FileAttributes.Normal)
IO.File.SetAttributes(File, IO.FileAttributes.Archive)

This happens on a network drive. The faulty files have weird permissions (see end of post), although reading and writing work perfectly.

Worse, even from Explorer, trying to change permissions fail, first asking for admin rights, then failing anyway:

Access denied, requiring admin rights
Failing anyway

Any ideas? I’m at a complete loss.


Here’s a screenshot of file permissions:
This one works:

Authorized access

This one does not:

Unauthorized access

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T10:17:49+00:00Added an answer on May 29, 2026 at 10:17 am

    I don’t know French much at all( that is the language correct?) but it looks like the first one works because you are a user on the server side (Linux user). When working over network drives, you have to have permissions on the server to change file attributes. Otherwise, it will have to be changed on the server end.

    Edit: Some servers also can change file permissions when saved to a network drive depending on the server settings and type of file. These changes may be locked down to only someone with server credentials can modify them and the code then fails with that exception.

    Edit2: It’s also possible that it also could be tied down on the server end by indexing and after a few minutes, you will get acccess back.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm running the following code to get a random entry from a dictionary: SELECT
Apple advises using the following code to detect whether running on an iPad or
I have the following code running, but I sometimes get some sort of concurrency
I have the following code running in a thread to enumerate the local machines
I have the following code running on my Android device. It works great and
I'm running the following code to update the database according to the data I
I am running the following code in tableView:cellForRowAtIndexPath: File *file = [[File alloc] init];
I'm running the following code on a list of strings to return a list
When running the following code it leaves out one row. When I do a
When running the following code I get no output but I cannot work out

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.