Windows 7 Forums


Windows 7: How to always open any file w/ Notepad as Administrator

12 Jan 2010   #1

Windows 7
 
 
How to always open any file w/ Notepad as Administrator

I tried to figure out how to always open any file in Notepad as Administrator via the Explorer shell menu, and with some help from this forum, I have succeeded!



1. Enable the Built-in Administrator Account
2. Set the password on the Administrator account to, say, "YOUR_PASSWORD".
3. Run regedit.
4. Goto to HKEY_CLASSES_ROOT\*\shell\
5. Create a new key named "Open with Notepad (as Administrator)"
6. Select the new key, and create another named "command".
7. Right click on the value named "(Default)" and select "Modify...".
8. Set the value to "runas /savecred /user:HOSTNAME\Administrator "notepad %1"".
a. Ensure that you leave quotes around "notepad %1".
b. Ensure that HOSTNAME matches the name of your machine.

9. Right click on a text file, and select "Open with Notepad (as Administrator)" from the shell menu. You'll be prompted for the password that you provided in step 2. You will only be prompted for this password once (due to /savecred).

You might want to combine this tip with "Image File Execution Options" to replace the built-in notepad with a better one (like Notepad2).

One annoying downside of this method is that even after you provide the password, a command prompt briefly flashes before opening notepad. I'm not sure how to prevent this.

Also, I'm not sure if you'll have to reenter the Administrator password after rebooting or otherwise logging out (haven't tested that yet).

Last edited by throttle; 12 Jan 2010 at 06:39 PM.. Reason: The title was a bit wrong. Clarified the purpose.
My System SpecsSystem Spec

Reply

 How to always open any file w/ Notepad as Administrator problems?



Thread Tools



Similar help and support threads for: How to always open any file w/ Notepad as Administrator
Thread Forum
Text File does not open with Notepad Software
Solved Can't open notepad as a administrator General Discussion
Force notepad to run as administrator System Security
Trying to copy txt file in Notepad. "Notepad: Access is denied" General Discussion
.vbs file open with notepad...how to change??? General Discussion


All times are GMT -5. The time now is 08:53 PM.


Seven Forums Android App Seven Forums IOS App Follow us on Facebook

Windows 7 Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows 7" and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32