Wednesday, December 1, 2010

File Access Denied in Windows 7

Any sufficiently advanced technology is indistinguishable from magic.
- Arthur C. Clarke
Cancel or Allow?
- Mac vs. PC: Windows Vista
Windows 7 is (I think, I hope) a big improvement on Windows Vista but one thing remains the same: my inability to understand what's going on with users, privileges and security rules in a modern Windows environment.

But, when in Rome... I refuse to turn off any of the new security settings just because Windows 7 makes life difficult... I will wait until it makes life impossible like Vista did, and that hasn't happened yet.

Mac and Linux Fans: Stop Reading Now

( yes, yes, we all know how wonderful life is in your world, please don't rub it in :)
One of those "makes life difficult" moments is the "access denied" message when you are trying to copy a file. This can happen even if you are logged on to Windows 7 with the only account available, and that account is set up as an "Administrator"... what gives?

Here's an example, the Foxhound "post-setup" command file which runs during installation after the Installshield setup.exe has done its thing:

It turns out there is a secret hidden "Administrator" account called, wait for it, "Administrator" in Windows 7. And to paraphrase George Orwell, all Administrators are equal but one Administrator is more equal than others.

Here's how you can make that secret Administrator visible and available for use:
  1. Open a "command prompt" window in "Administrator" mode...
    start - All Programs - Accessories - right mouse click on Command prompt - Run as Administrator

  2. Make the magic Administrator account visible in Windows 7 by typing this command and pressing Enter...
    net user administrator /active:yes

  3. Log off your normal account, and login as Administrator.
Now you can do all those things you thought you could with your regular account, but couldn't.

Tip: If you want the freedom to use the magic Administrator account whenever you feel like it, you should probably give it a password. Or, if you want to hide it again, run this command...
net user administrator /active:no

No comments: