When you click right-click->Edit with Notepad ++ and get the error “ShellExecute failed (2): Is this command correct?” as seen below:
Solution of ShellExecute Failed (2) Error:
This problem seems to happen after setting Notepad++ to run as administrator on Windows.
To fix it, we will do the following:
1. Open the registry by pressing Win+R (window key and the “r” keys), following by entering “regedit” without the quotes and press enter
2. Go to the HKEY_CLASSES_ROOT key as shown below
3. Search for “notepad++.exe” under that key which has an entry Edit with Notepad++ or Edit with &Notepadd++ (Below is an example)
4. Once found, delete the whole key (it is recommended to take a backup first using right-click->Export first)
If done correctly, the “Edit with Notepad ++” would disappear like shown in the below before/after figure.
Now we need to recreate it but a working version this time.
5. Go to
6. Create a new key under shell called
OpenWithNotepad and create a subkey under that called
command as seen below:
7. Inside the
OpenWithNotepad key, set the (Default) string variable to “Edit with Notepad ++”
8. Create a new string variable called icon and set the value to
path-to-notepad++.exe where path-to-notepad++.exe is the full path, e.g.
C:\Program Files\Notepad++\notepad++.exe. In my case, I had to set it to
C:\Program Files (x86)\Notepad++\notepad++.exe since I am running a windows 64-bit version.
9. Inside the
command key, set the default string as
"path-to-notepad++.exe" "%1" where path-to-notepad++.exe is the full path as we did in step 8
You are done, now you should find a working “Edit with Notepad++” that does not throw out the error in the beginning of this post.