First thing you want to do is verify if it is a problem in the entire cmd structure tree, or just .bat files.
If you rename the .bat file to .cmd, does it work? If so, compare .bat and .cmd and see what's different.
Good test! I renamed the .bat file to .cmd and it worked! From the command line I typed assoc .cmd and .cdm=cmdfile was returned. Am now in the process and work out what the differences are between HKEY_CLASSES_ROOT\batfile and HKEY_CLASSES_ROOT\cmdfile.
Awesome. So now we need to fix the .bat extension. You can look at how the .cmd extension is setup and set that for the .bat extension as well.
I executed the other answer, but now an empty command prompt is opening when I doubleclick the .bat file, the actual batfile is not running though.
Okay, so you have reset the association with .bat files.
You should look into the HKEY_CLASSES_ROOT .bat and .cmd keys too and especially check the subfolders.
I've now made exactly one change to [HKEY_CLASSES_ROOT\batfile\shell\Open\command]. This was to change the value from @="\"C:\Windows\System32\cmd.exe\" \"%1\"" to @="\"%1\" %*". Batch files now work...which is great but I'm beginning to doubt my sanity. I could have sworn that I checked this and tried that exact same registry setting as I was going round the loop! It feels like there are some hidden Windows settings here...
No, you basically reset the key when executing the other answer, and now it really does solve the problem. This is really fixed. :)