In Windows, when I open a file using 'Open With...' in context menu, how can I open that application (notepad) 'as administrator'?

My user account already has administrator right. And when I 'open with ...' in context menu, and when I save the file, I get permission declined.

I work around it by going to task bar, and right click notepad and 'run as administrator', open the same file, and save it. It works if I do that.


Go into:


Find Notepad.exe

Right click: create shortcut

Save the shortcut to your desktop

Then, go into shortcut properties, click advanced, run as admin. Now you can use this shortcut to run notepad as admin!

EDIT: The shortcut cant be added to open with, but I found this simple little app to add a Open with Notepad Admin to context menu:


CopyFiles = NotepadAsAdmin.Files.Inf
AddReg    = NotepadAsAdmin.AddReg

CopyFiles = NotepadAsAdmin.Files.Inf
AddReg    = NotepadAsAdmin.AddReg

DelFiles  = NotepadAsAdmin.Files.Inf
DelReg    = NotepadAsAdmin.DelReg

55="Notepad as Admin","",1


NotepadAsAdmin.Files.Inf = 17


HKLM,%UDHERE%,UninstallString,,"rundll32.exe syssetup.dll, SetupInfObjectInstallAction DefaultUninstall 132 %17%\NotepadAsAdmin.inf"
HKCR,*\Shell\runas\command,,,"%11%\notepad.exe ""%1"""


NotepadAsAdminName="Notepad as Admin PowerToy (Uninstall only)"
NotepadAsAdminAccel="Notepad as Admin"

Now paste the code into notepad, save as notepadadmin.inf. Now, right click the file and click install. All done! This can be uninstalled though control panel.

Original link: http://www.wikihow.com/Add-an-%22Open-With-Notepad-As-Administrator%22-Shortcut-to-the-Context-Menu-in-Windows-7-and-Windows-Vista

  • you can also use a shortcut to do the same thing without copying the executable – Aaron Ladd Apr 27 '16 at 17:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.