Like you, I use Notepad all of the time for simple edits. It is fast and pretty functional. This praise stops when UAC is involved though. To see what I mean, try editing a file (script, txt, ini, etc) in a protected location like Program Files or System32. After making any changes, you will receive a big message saying that you don’t have rights to save this file.
In the same way that we hacked Command Prompt for the greater good, we can effortlessly make Notepad run as an administrator. Let’s find out how!
The Single Regedit to Run Notepad as an Administrator
On your machine, launch regedit and navigate to: HKEY_CLASSES_ROOT\*\shell. Within shell, create a new key named: Open with Notepad (Administrator) . Create a subkey named command .
Within the command key, right click on (Default) and select Modify. Paste in the following: runas /user:COMPUTERNAME\Administrator “notepad %1” .
Be sure to change COMPUTERNAME to your machine name. If you rename the default local administrator account, you will need change Administrator as well. Finally, be sure that the local administrator account is enabled.
To see your change, log off and log back on. Right click on any file and you should see an option to Open with Notepad (Administrator). This will launch Notepad as the local administrator account. Because UAC doesn’t apply to the local administrator, you can save wherever you please!
The Single Preference to Run Notepad as an Administrator
But why stop with just a single (manually created) registry edit! Save future you some time and create a Group Policy Registry Preference to automatically create this key. In your IT GPO (or something similar), create a new computer side Registry Preference.
Set the preference action to Create and change the hive to HKEY_CLASSES_ROOT. For the keypath, paste in: *\shell\Open with Notepad (Administrator)\command . Check the Default box and paste in the following for the value data: runas /user:%ComputerName%\localadmin “notepad %1”
Now here is the final trick – ensure that everyone in your IT department gets this setting. But don’t tell anyone that you did this! When they get an Access Denied message with Notepad, show them the Right Click option that you created. They will then ask, “When did that button appear?”. Tell them it has been there since Windows 2000… think of it like your own little game of Inception…