News:

MultiCommander v16.6 is released!

Main Menu

Custom Command to Run in Git Bash

Started by parcher, November 26, 2016, 17:27:30

Previous topic - Next topic

parcher

I want to create a custom command to run the program G'Mic within Git Bash on selected images.

Command:

gmic *jpg -gimp_montage 4,\""V(H(0,1),H(2,V(3,4)))"\",1,1.0,0,5,0,0,0,255,0,0,0,0,0 -o 0000.jpg

This command takes jpg images, from which a montage of the jpgs is created.

This is what I have:

Group: MC
Function: Run
Options/Parameters: ADMIN

Command Type: Custom Commands

Command:

MC.Run CMD="gmic *jpg -gimp_montage 4,\""V(H(0,1),H(2,V(3,4)))"\",1,1.0,0,5,0,0,0,255,0,0,0,0,0 -o 0000.jpg"


When I run this command on selected jpgs I see the Windows command shell quickly open and close and not perform the requested action. This is because the command doesn't work in Windows command shell. It needs to run in Git Bash, which I have installed and have confirmed works with this command.

I assume I need to tell MultiCommander to run this command in Git Bash. But how to do it? And will the resulting montage be placed in the folder of the source images?

My Git Bash path: C:\Program Files (x86)\Git\bin\sh.exe

Mathias (Author)

MC will send the everything in the CMD="" and Windows to run it. 
You need execute sh.exe from CMD and the thing you want it to run as a parameter to it. if that is possible. Not sure how sh.exe works

How would you run it from a normal console problem. ?
Maybe easier to create a UserDefinedCommand of Batch that create a .bat script and in that you maybe can launch sh and this things.

However you need to include sh.exe some way..  There is no way of MC to know about sh.exe

parcher

I found a solution:

C:\Windows\System32\cmd.exe /c ""C:\Program Files (x86)\Git\bin\sh.exe" --login -i -- C:\Users\Scripts\gmicmont.sh"

Command type: External