In my case, I had a trojan that changed different settings on my computer, including registry keys. After removing the trojan I ran a program called SDFix to reset the settings that the trojan had changed. The program ran very well, but have a bug. When it reset the registry key used to edit batch files (*.bat) it set it as follow:
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\batfile\shell\edit\command] = %SystemRoot%\System32\NOTEPAD.EXE %1"
As you already probably notice there is lonely quote at the end of the value. Just delete that quote and you are done.
As always, you edit the registry at your own risk.