27

I'd like to add an "Open with Notepad++ as Administrator" context menu for all files to Windows 7.

I've tried the solutions listed here: Run a program from context menu with admin priveledges (vista UAC)

with minimal success. I'm running windows 7 home premium 64-bit. Does anyone have either more explicit instructions, or a different solution?

Thanks!

wulftone
  • 973

5 Answers5

25

Reading a privileged file is not the problem. Save changes is.

Download latest plugin nppsaveasadmin:

http://sourceforge.net/projects/nppsaveasadmin/

Decompress on your plugins folder: (only NppSaveAsAdmin.dll)

C:\Program Files (x86)\Notepad++\plugins

Restart notepad++, and next time you will be prompted every time a file needs admin rights to change it.

You can try on C:\Windows\System32\drivers\etc\hosts to see the effects.

albfan
  • 561
6

to do this i used 2 programs

1 - Elevate Power Toy : http://technet.microsoft.com/en-us/magazine/2008.06.elevation.aspx

2 - Context Edit : http://www.softpedia.com/progDownload/ContextEdit-Download-78704.html

first i downloaded elevate power toy and unziped it. after that in context edit (which you should run as admin too) i created a new entry and name it Notepad++ Admin

To new entry's command line write : "[Path]\Elevation\elevate.cmd" "C:\Program Files (x86)\Notepad++\notepad++.exe" "%1"

after that you can see Notepad++ Admin on all items. i added screenshot for command options (actually nothing is selected).

alt text

0

Here's a free utility which creates a "Open in Notepad as Admin" in Windows Explorer Context-Menu for any file. Comes with proper uninstaller.

Get it here - How to Add an "Open With Notepad As Administrator" Shortcut to the File Context Menu in Windows 10.

enter image description here

Markus
  • 189
0

Found the link to an inf context installer for 32 bit NPP, thanks to @nooblet, here's the modified text for 64 bit NPP:

[version]
Signature="$Windows NT$"

[Notepad++ElevatedInstall] CopyFiles = Notepad++Elevated.Files.inf AddReg = Notepad++Elevated.AddReg

[DefaultInstall] CopyFiles = Notepad++Elevated.Files.inf AddReg = Notepad++Elevated.AddReg

[DefaultUnInstall] DelFiles = Notepad++Elevated.Files.inf DelReg = Notepad++Elevated.DelReg

[SourceDisksNames] 55="Edit with Notepad++ (elevated)","",1

[SourceDisksFiles] NotepadppElevated.inf=55

[DestinationDirs] Notepad++Elevated.Files.inf = 17 ; inf file directory

[Notepad++Elevated.Files.inf] NotepadppElevated.inf

[Notepad++Elevated.AddReg] ; 0x00001000 (FLG_ADDREG_64BITKEY) HKLM,%UDHERE%,DisplayName,,"%Notepad++ElevatedUninstallName%" ;HKLM,%UDHERE%,DisplayIcon,,"%CONTEXTPATH% ""0""" HKLM,%UDHERE%,UninstallString,,"rundll32.exe syssetup.dll, SetupinfObjectInstallAction DefaultUninstall 132 %17%\NotepadppElevated.inf" HKCR,\shell\runas,,,"%Notepad++ElevatedContextName%" HKCR,\shell\runas\command,,,"%BINPATH% ""%1""" HKCR,*\shell\runas,"Icon",,"%CONTEXTPATH%"

[Notepad++Elevated.DelReg] HKLM,%UDHERE% HKCR,*\shell\runas

[Strings] Notepad++ElevatedUninstallName="Edit with Notepad++ (elevated) -- Uninstall only" Notepad++ElevatedContextName="Edit with Notepad++ (elevated)" UDHERE="Software\Microsoft\Windows\CurrentVersion\Uninstall\Notepad++Elevated" BINPATH="C:\Program Files\Notepad++\notepad++.exe" CONTEXTPATH="C:\Program Files\Notepad++\notepad++.exe" ;hex functions like hex(2)=> REG_EXPAND_SZ dont't work in inf. ;separate long strings with pipe

Save the above to a plain text file named NotepadppElevated.inf, right click to install. Uninstall by locating the Edit with Notepad++ (elevated) -- Uninstall only entry in Installed Apps.

Edit: The Notepad++ icon is replaced by a default on the W11 right-click menu, no issues on the (=> W10) styled classic menu,

0

You could also try with this to run an elevated scheduled Task

http://www.winhelponline.com/blog/run-programs-elevated-without-getting-the-uac-prompt/

and the to add to an context menu:

http://www.howtogeek.com/howto/windows-vista/add-open-with-notepad-to-the-context-menu-for-all-files/

patricks
  • 636