Multi Commander > Support and Feedback
No parameters possible for commands runnig from command bar?
Mathias (Author):
there is no 16bit any more.. there is only cmd.exe and it runs both of the.. the only different is some default behavior of ERRORLEVEL variable in bat script works.
Dont know why .cmd does not work. everything should be forwarded. and windows should just run the command.
A workaround to create a bat that calls the .cmd with same paramters
Tom:
If you only have x.cmd (no x.bat) and run "x 1 2 3 4 5" instead of "x.cmd 1 2 3 4 5" then the output is correct. So I think .cmd is misinterpreted by MC, most likely interpreted as alias command or something else.
Can you debug the MC source while running the above two commands? The first runs correct, the second in another wrong way. Debugger should be able to tell where it's going wrong.
Tom:
If you look at the Log after you run x.cmd 1 2 3 4 5 you see:
2016-12-17 23:28:45.067 Unknown Command : "x.cmd 1 2 3 4 5"
2016-12-17 23:28:45.067 Execute using MultiCommander FileType Setup : "x.cmd"
If you look at the Log after you run x 1 2 3 4 5 you see:
2016-12-17 23:29:12.835 Unknown Command : "x 1 2 3 4 5"
2016-12-17 23:29:12.835 Execute using MultiCommander FileType Setup : "x"
2016-12-17 23:29:12.835 ShellExecute(NULL, _T("open"), "x", "1 2 3 4 5" , "E:\", SW_SHOW);
2016-12-17 23:29:12.842 ShellExecute returned without any error
So with the extension .cmd the ShellExecute isn't logged and not executed the way it should. So clearly a different handling from MC side.
Mathias (Author):
Actually, Both of them end up in ShellExecute.. but the first is going via FileType Setup configuration. (Menu > Config > FileType setup)
Tom:
Thanks for the hint. Under Configuration, File Type Setup..., Launchers (Run/Open) I added:
Name = Cmd
Program Path = C:\Windows\System32\cmd.exe /c
Program Parameters = "${filepath}"
Icon = not selected
File Extensions = *.cmd
Path Matching =
With this setting the batch x.cmd 1 2 3 4 5 runs as expected and the log shows:
2016-12-18 19:45:20.661 Unknown Command : "x.cmd 1 2 3 4 5"
2016-12-18 19:45:20.661 Execute using MultiCommander FileType Setup : "x.cmd"
2016-12-18 19:45:20.705 ShellExecute(NULL, _T("open"), "x.cmd", "1 2 3 4 5" , "E:\", SW_SHOW);
2016-12-18 19:45:20.734 ShellExecute returned without any error
So finally a functional workaround. Thanks a lot.
Navigation
[0] Message Index
[*] Previous page
Go to full version