Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Windows 7 Error: Is this command correct?

ShellExecute failed (2): Is this command correct? "C:\Program Files (x86)\Notepad++\notepad++.exe [location of file to edit]

I seem to have some issue with RIGHT CLICK > Edit with Notepad ++. This is on a fresh install of Microsoft Windows 7 Professional 64-Bit.

I can't seem to find any notice of this error? Or is this just some Windows 7 config issue?

share|improve this question
4  
Notepad++ works fine on my Win 7 x64. Try reinstalling – Sathya Nov 20 '10 at 2:33
I attempted installing to Program Files instead of the x86 program files directory, this did not solve the problem. I think the issue is that the shell extension is running from a DLL that does not have administrative access. I believe it to be NppShell_04.dll so if we figure out how to tell Windows 7 give that administrative access to run, then we are golden. – Steve Dec 24 '10 at 19:39
-1 you should've included a keyword from the error in the title, then people will know before they've even clicked – barlop Sep 11 '11 at 19:20

8 Answers

up vote 5 down vote accepted

I have Windows 7 64 Bit and I'm working with Notepad++ for more than a year on different Windows 7 64 Bit installation and I never seen such an error. Are you tried complete uninstall, run CCleaner, and installing Notepad++ again?

share|improve this answer
1  
CCleaner isn't going to make a damn bit of difference here. The reinstall should fix it though,. – Billy ONeal Nov 19 '10 at 23:40
I've tried a re-install, thats the funny thing. I am not sure what the issue is, I will try an uninstall, check registry entries and do a full install again. – Jakub Nov 21 '10 at 3:50
1  
I tried the uninstall method, and fully cleaned the registry of all Notepad++ references. A new re-install worked. Strange... – Jakub Nov 22 '10 at 13:53

This is caused when you set Notepad++ to run as administrator on Windows 7.

Go into your registry as an administrator and search for notepad++.exe. Find the key under HKEY_CLASSES_ROOT that has an entry with the Edit with Notepad++ and delete the whole key. Right click and you should see that you no longer have that option.

Now we re-create it:

  1. Go to:

    HKEY_CLASSES_ROOT\*\shell
    
  2. Create a new key under shell called OpenWithNotepad and create a subkey under that called command.

  3. In the OpenWithNotepad key the default string is what you want the context menu item to be called. I set it to Open with Notepad++.

  4. Create a new string value called icon and set the value to be the full path to notepad++.exe.

  5. Under the command key edit the default string value and change it to "path-to-notepad++.exe" "%1" where path-to-notepad++.exe should be the full path, e.g. C:\Program Files\Notepad++\notepad++.exe.

When you right click this option it should now ask you properly for giving Notepad++ admin access to a file.

You still need to go to the properties for notepad++.exe and set it to run as an administrator.

share|improve this answer
2  
Thanks. This is the right answer. :D – theo Jun 8 '11 at 15:17
1  
This is the only answer that successfully lets me still use "Open as administrator" with Notepad++. – Allbite Dec 24 '11 at 17:01
Wonderful, Great answer, thanks. – Jeff F. Oct 18 '12 at 19:41
Perfect, thank you; I really figured I was OOL here since I didn't have the time to spend right ATM to find what reg keys I needed through dint of effort, but "found it almost first on SuperUser by Googling" I fortunately had the time for... :) – shelleybutterfly Oct 19 '12 at 17:37
Worked perfectly for me on Windows8 too. Thanks. – LDJ Dec 7 '12 at 8:16
show 2 more comments

On my Windows 7 machine (32 bit) I set notepad++ to run as administrator, doing so caused the explorer shell extension to stop working with the "Shell Execute failed" error. Disabling this setting (right click, properties, compatibility...) resolved the issue. Maybe this is what is causing your problems? (Now all I need is an "Edit in Notepad++ as Administrator" shell extension....)

share|improve this answer
This resolved the issue for me. – AaronLS Jan 26 '11 at 4:57
Thanks, that did the trick for me too – Sébastien Nussbaumer Jun 10 '11 at 15:11
This worked for me too. I was using windows 7 ultimate 64bit. – moomoochoo Sep 19 '12 at 15:41
The same happended to me when I pinned Notepad++ to the taskbar and checked Shift+Right click -> Properties -> Compatibility -> Run this program as an administrator. Unchecking and selecting Shortcut -> Advanced -> Run as Administrator helped. – too Apr 5 at 14:16

This is a registry file that might help everybody:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\OpenWithNotepad]
@="Edit with &Notepad++"
"icon"="C:\\Program Files (x86)\\Notepad++\\Notepad++.exe"

[HKEY_CLASSES_ROOT\*\shell\OpenWithNotepad\Command]
@="\"C:\\Program Files (x86)\\Notepad++\\Notepad++.exe\" \"%1\""

Copy it into Notepad and save it with a .reg extension. Close Notepad and double-click the file.

share|improve this answer

Uninstall, clean registry and re-installing didn't work for me. Neither was I running in a compatibility mode so that could not have been my issue.

What the issue was for me is that I checked the option "Run this program as an administrator" in the compatibility tab. I had turned this option on to be able to save e.g. the hosts file. After unchecking this I finally could rightclick and edit files using NotePad++ again.

share|improve this answer
This was an easy fix. Started down the path of the regedit and went ugh. Tried this, totally worked. – jcollum Apr 5 '12 at 19:48

in case you did not get it fixed yet, i had the same issue and tried all the above. I had told Notepad++ to start in compatibility mode and got that error. After i turned it off, everything went back to normal.

share|improve this answer

In my case thing that helped was to install Notepad++ in regular "Program Files" directory, not in "Program Files (x86)". Path is just messed up :)

Hope it helps!

share|improve this answer

I've had persistent problems with Notepad++ (on 5.9) in regards to opening/editing files via explorer interface (both direct click to open and right-click to edit..etc). The solution for me has been to install Notepad++ in C:\Program Tools\Notepad++\ - if I try any of the "official" install locations Notepad++ only opens things right when run in admin mode (which is a UAC pain in the arse if you'll pardon my french)

share|improve this answer

protected by studiohack May 12 '11 at 15:06

This question is protected to prevent "thanks!", "me too!", or spam answers by new users. To answer it, you must have earned at least 10 reputation on this site.

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