Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

How to open files as Administrator?


  • Please log in to reply
9 replies to this topic

#1
Tripredacus

Tripredacus

    K-Mart-ian Legend

  • Super Moderator
  • 9,907 posts
  • Joined 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Donator

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?
MSFN RULES | GimageX HTA for PE 3-5 | lol probloms
msfn2_zpsc37c7153.jpg


How to remove advertisement from MSFN

#2
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,572 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag
Workarounds:
http://www.sevenforu...inistrator.html

http://www.howtogeek...-windows-vista/
http://www.recipeste...dows_7_37738078
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. :unsure:

jaclaz

#3
cluberti

cluberti

    Gustatus similis pullus

  • Supervisor
  • 11,252 posts
  • Joined 09-September 01
  • OS:Windows 8.1 x64
  • Country: Country Flag
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.
MCTS Windows Internals, MCITP Server 2008 EA, MCTS MDT/BDD, MCSE/MCSA Server 2003, Server 2012, Windows 8
--------------------
Please read the rules before posting!
Please consider donating to MSFN to keep it up and running!

#4
Tripredacus

Tripredacus

    K-Mart-ian Legend

  • Super Moderator
  • 9,907 posts
  • Joined 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Donator

Workarounds:
http://www.sevenforu...inistrator.html

http://www.howtogeek...-windows-vista/
http://www.recipeste...dows_7_37738078
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. :unsure:

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.
MSFN RULES | GimageX HTA for PE 3-5 | lol probloms
msfn2_zpsc37c7153.jpg

#5
MrJinje

MrJinje

    Toolâ„¢ Developer

  • Developer
  • 1,051 posts
  • Joined 14-October 09
  • OS:Server 2012R2
  • Country: Country Flag
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, 17 December 2009 - 08:56 AM.


#6
cluberti

cluberti

    Gustatus similis pullus

  • Supervisor
  • 11,252 posts
  • Joined 09-September 01
  • OS:Windows 8.1 x64
  • Country: Country Flag
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).
MCTS Windows Internals, MCITP Server 2008 EA, MCTS MDT/BDD, MCSE/MCSA Server 2003, Server 2012, Windows 8
--------------------
Please read the rules before posting!
Please consider donating to MSFN to keep it up and running!

#7
Tripredacus

Tripredacus

    K-Mart-ian Legend

  • Super Moderator
  • 9,907 posts
  • Joined 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Donator

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.
MSFN RULES | GimageX HTA for PE 3-5 | lol probloms
msfn2_zpsc37c7153.jpg

#8
cluberti

cluberti

    Gustatus similis pullus

  • Supervisor
  • 11,252 posts
  • Joined 09-September 01
  • OS:Windows 8.1 x64
  • Country: Country Flag
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.
MCTS Windows Internals, MCITP Server 2008 EA, MCTS MDT/BDD, MCSE/MCSA Server 2003, Server 2012, Windows 8
--------------------
Please read the rules before posting!
Please consider donating to MSFN to keep it up and running!

#9
nitroshift

nitroshift

    Beware of programmers with screwdrivers!

  • Super Moderator
  • 2,907 posts
  • Joined 29-November 05
  • OS:Windows 8.1 x64
  • Country: Country Flag

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 ;)

Please read the rules, folks!


#10
Tripredacus

Tripredacus

    K-Mart-ian Legend

  • Super Moderator
  • 9,907 posts
  • Joined 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Donator

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. :lol:
MSFN RULES | GimageX HTA for PE 3-5 | lol probloms
msfn2_zpsc37c7153.jpg




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users