Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble

MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, register and become a site sponsor/subscriber and ads will be disabled automatically.

# How to open files as Administrator?

## Recommended Posts

Tripredacus    283

So far I've got no problems with Windows 7 except one. Some programs I open won't let me save files unless I run them as Administrator. Its not all programs. Here is an example: I open a text file by double-clicking it in Explorer and it opens in Notepad. I make some changes, then do File->Save. Well it asks me if I want to replace the existing file, I click Yes and then it says Access Denied. The only way I can edit a text file is if I run Notepad as Administrator and then open the file I want to change.

Other programs, such as Scite and Flash are not picky like that and I can edit things and save them without running as Administrator.

How can I make Notepad work the way I want it to?

##### Share on other sites

jaclaz    910

Workarounds:

http://www.sevenforums.com/system-security...inistrator.html

http://www.howtogeek.com/howto/windows-vis...-windows-vista/

It should be possible to also add the command to the "default" action for the file type, i.e. the one that is executed by double clicking.

jaclaz

##### Share on other sites

It also depends on the location of the file, file permissions, and owner. If you're getting a UAC prompt to save files in your profile, for example, that's bad, but if you're getting errors saving to a protected location like the root of a drive, or \Windows, or \Program Files, etc, that's expected behavior.

##### Share on other sites
Tripredacus    283
Workarounds:

http://www.sevenforums.com/system-security...inistrator.html

http://www.howtogeek.com/howto/windows-vis...-windows-vista/

It should be possible to also add the command to the "default" action for the file type, i.e. the one that is executed by double clicking.

jaclaz

This definately seems to be on the right track, but .txt files have a different registry layout than Zip or Compressed Files do. For example, it has:

- OpenWithProgids

- PersistentHandler

- ShellNew

Would I export ShellNew? Not sure how to continue with that.

No Cluberti, I do not get UAC prompts, it just says access denied. The files are on a separate data drive. I do not save anything into my profile.

##### Share on other sites
MrJinje    11

Try this out, I went into .txt and the default was "txtfile" so I went and made the changes at [HKEY_CLASSES_ROOT\txtfile\shell\runas] and it worked. (at least for right click)

Windows Registry Editor Version 5.00[HKEY_CLASSES_ROOT\txtfile\shell\runas][HKEY_CLASSES_ROOT\txtfile\shell\runas\command]@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\  00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,4e,00,4f,00,\  54,00,45,00,50,00,41,00,44,00,2e,00,45,00,58,00,45,00,20,00,25,00,31,00,00,\  00

Here are the main keys I looked at.

HKEY_CLASSES_ROOT\.txt

HKEY_CLASSES_ROOT\SystemFileAssociations\text

HKEY_CLASSES_ROOT\txtfile

Edited by MrJinje

##### Share on other sites

The question though is "why" - assuming that drive isn't locked down, you should be able to open files on it without a full admin token. What does process monitor say about the file open attempt?

I know opening them as admin gives you a work-around, but honestly this is pretty odd behavior (especially if you're already in the admin group).

##### Share on other sites
Tripredacus    283

I did pull a procmon of opening, writing to and saving a text file, but I think I may have figured out why this might be happening.

First, I am not only in the Administrators group, I actually log in as the Local Admin account. However, the HDD with my data on it is from my old computer, which ran Server 2003. Could this possibly be the reason? The file ownership and SID are likely different from the OS drive than the data drive.

I just did a quick test. Notepad cannot save a file to the old data drive, but can save to the one that was formatted by this computer.

##### Share on other sites

That is actually exactly why it's happening. Take ownership of everything on the drive and push more appropriate permissions down afterwards, and things should clear up.

##### Share on other sites
That is actually exactly why it's happening. Take ownership of everything on the drive and push more appropriate permissions down afterwards, and things should clear up.

Indeed, just check the box that says "replace all child object permissions with inheritable permissions from this object" and you're set, Trip Saves a lot of time going through all the folders / files on the drive

##### Share on other sites
Tripredacus    283

Yeah, I took ownership of the drive and that problem was solved. Now my only issue is if I mount a WIM with the PE Tools Command Prompt, I get an access denied when copying files into mount\windows\system32. I am guessing because its named system32, but I have tried to mount it into different drives and get the same thing. So I've had to use UncleSocks again just to edit WIMs.

## Create an account

Register a new account