I want to change the default program to open .bat files to cmder , so in the registry key : HKEY_CLASSES_ROOT\batfile\shell\open\command I did as following :

enter image description here

But when I open some .bat file I get the following error :

enter image description here

How can I solve this ?

Edit :

I changed the registry key value to : C:\Dev\Cmdr\Cmder.exe "%1"

But I get this message whenever I open some batch file:

The directory name is invalid.

enter image description here

  • 1
    "some" .bat files or all of them? Anything in particular about the bat files or their location? – Mokubai Dec 26 '17 at 11:52

You need to use quotes around the %1, otherwise paths with blanks in them arrvie as separate parameters: ...cmder “%1”


I tried with ConEmu. I appended this string to the existing:

C:\(path_to_app)\ConEmu64.exe "%1" %*

The last part ("%1" %*) was there before the edit.

So I think you need to add %* after your whole string value in regedit (in your case): C:\Dev\Cmdr\Cmder.exe "%1" %*

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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