0

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.

0

Go into:

Drive:\Windows\System32\

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:

[version]
signature="$CHICAGO$"

[NotepadAsAdminInstall]
CopyFiles = NotepadAsAdmin.Files.Inf
AddReg    = NotepadAsAdmin.AddReg

[DefaultInstall]
CopyFiles = NotepadAsAdmin.Files.Inf
AddReg    = NotepadAsAdmin.AddReg

[DefaultUnInstall]
DelFiles  = NotepadAsAdmin.Files.Inf
DelReg    = NotepadAsAdmin.DelReg

[SourceDisksNames]
55="Notepad as Admin","",1

[SourceDisksFiles]
NotepadAsAdmin.INF=55

[DestinationDirs]
NotepadAsAdmin.Files.Inf = 17

[NotepadAsAdmin.Files.Inf]
NotepadAsAdmin.INF

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

[NotepadAsAdmin.DelReg]
HKLM,%UDHERE%
HKCR,Directory\Shell\runas
HKCR,Drive\Shell\runas

[Strings]
NotepadAsAdminName="Notepad as Admin PowerToy (Uninstall only)"
NotepadAsAdminAccel="Notepad as Admin"
UDHERE="Software\Microsoft\Windows\CurrentVersion\Uninstall\NotepadAsAdmin"

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.