locked
A read only Administrator cannot perform this operation - Windows 7 RRS feed

  • Question

  • I am a domain user and have added myself to the local system administrators group. I am creating applications using Visual Studio that read / write files in the local system. I get this error when I try to write to the file:

    A read only administrator cannot perform this operation.

    This occurs only in windows 7. Works fine in XP/2003.

    Regards,
    Sandeep
    Saturday, July 18, 2009 7:11 PM

Answers

  • The error message you've cited isn't one with which I'm familiar, but it makes sense in the context of UAC; a protected administrator running an application without elevation might be termed a 'read only' administrator by some toolkit.  Contrary to popular misconception, UAC prompts only occur at the start of an application; a process does not have the ability to 'temporarily' elevate/de-elevate without creating another process to do its work.  Which is to say, if you attempt to write a file in your application, and that location isn't a place a standard user can write to, and your application is not running elevated, it will fail, not generate a UAC prompt.

    Read the link.

    Thursday, August 6, 2009 6:51 PM

All replies

  • You didn't mention Vista, so I'm going to assume that you are perhaps unfamiliar with UAC, and that you are writing to a non-standard-user-writable location from an application that is running without elevation.

    If that sounds correct, or you don't get what that means, read this and related resources:

    Windows Vista Application Development Requirements for User Account Control (UAC):
    http://msdn.microsoft.com/en-us/library/aa905330.aspx
    Monday, July 20, 2009 9:14 PM
  • Apparently its not a problem with vista. I guess if UAC is configured it would prompt for credentials if the application is trying to write to a non standard location. It doesn't prompt which is supposed to be the default behavior.
    Thursday, August 6, 2009 11:45 AM
  • The error message you've cited isn't one with which I'm familiar, but it makes sense in the context of UAC; a protected administrator running an application without elevation might be termed a 'read only' administrator by some toolkit.  Contrary to popular misconception, UAC prompts only occur at the start of an application; a process does not have the ability to 'temporarily' elevate/de-elevate without creating another process to do its work.  Which is to say, if you attempt to write a file in your application, and that location isn't a place a standard user can write to, and your application is not running elevated, it will fail, not generate a UAC prompt.

    Read the link.

    Thursday, August 6, 2009 6:51 PM