Multi Commander > Script

Execute a .BAT file for the selected files with some argument

(1/1)

ebat79:
I want to: "Execute a .BAT file for the selected files with some argument".
Here is the script i made:

--- Code: newbielink:javascript:void(0); [nonactive] ---@var $comp = "COMP-ACU2.bat";
@var $arr = GetSelectedFileNames();
@var $count = arrayCount($arr);
@var $n;
for( $n = 0; $n < $count; $n++ )
{
  @var $item;
  $item = PathGetNamePart( $arr[$n], 1 );
  MC.run CMD="COMP-ACU2.bat" ARG="{$item} DEBUG" SHELL;
}
--- End code ---

But the line:

--- Code: newbielink:javascript:void(0); [nonactive] ---MC.run CMD="COMP-ACU2.bat" ARG="{$item} DEBUG" SHELL
--- End code ---

Result in an error:

--- Code: newbielink:javascript:void(0); [nonactive] ---Script engine error - Line : 8, Error : -1 => Code : "MC.run CMD="COMP-ACU2.bat" ARG="{$item} DEBUG" SHELL"
--- End code ---

Any ideas?

Navigation

[0] Message Index

Go to full version