Take the 2-minute tour ×
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

9 Answers 9

up vote 6 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
2  
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. Still in the OpenWithNotepad key, create a new string value called icon and set the value to path-to-notepad++.exe where path-to-notepad++.exe should be the full path, e.g. C:\Program Files\Notepad++\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
4  
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
2  
Worked perfectly for me on Windows8 too. Thanks. –  LDJ Dec 7 '12 at 8:16
4  
My registry entry was "Edit with &Notepad++" –  Greg Woods Mar 5 '13 at 9:17
1  
Also, how could we combine this with a method to shut off UAC warnings? Everything I can find uses shortcuts; however this registry fix points directly to the executable. Because let's be frank, it's almost worse to right-click "Edit with Notepad++" a 10 files and then deal with 10 UAC prompts than to save everything to a temporary folder and then moving them to the destination, as is necessary without running Notepad++ as administrator. –  Ariane Jun 5 '13 at 5:14

I recently upgraded Notepad++ and I started getting this "ShellExecute failed" error when trying to use the "Edit in Notepad++" context menu feature.

While I found many reports of this error online, none of the solutions that I saw worked on my machine.

Here are the steps I used to resolve the problem:

  1. Right click on notepad++.exe in the Notepad++ program folder.
  2. Select the Properties menu item.
  3. Select the Compatibility tab.
  4. When “Run this program as an administrator” is enabled just for the current user, you can disable by clicking on the checkbox.
  5. Otherwise, "Run this program as an administrator” is enabled for all users and you have to click on “Change settings for all users” first, then you can disable the option.

I created an image for each of these scenarios and attached them below.

I highlighted "Run this program as an administrator” in both images and highlighted the “Change settings for all users” button in green for the scenario where the option was enabled for all users.

RunAsAdmin CurrentUser Scenario RunAsAdmin AllUsers Scenario

share|improve this answer
    
Thanks a lot Jeff. That fixed it. Give it a shot before playing around with Registry. If this does not work, then jump to Registry fixing. –  RuntimeException Aug 7 at 9:53

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
    
Thank you, random internet user. –  Little Helper Sep 29 at 19:14

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

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

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

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
1  
This worked for me too. I was using windows 7 ultimate 64bit. –  moomoochoo Sep 19 '12 at 15:41
1  
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 '13 at 14:16

protected by studiohack May 12 '11 at 15:06

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

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