User commands/bat files with ConEmu: very difficult

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
Axis
Junior Member
Junior Member
Posts: 88
Joined: 2015-07-14, 18:53 UTC

User commands/bat files with ConEmu: very difficult

Post by *Axis »

Hi.

Anyone with some conemu knowledge for running TC's user commands?

This works:

Command: cmd.exe /C ""%commander_path%\utils\test.bat""
Parameter: ?%F 20 8-10

("20" and "8-10" are parameters for the program listed inside test.bat)


Now, I find extremely difficult to accomplish the same with ConEmu (a frontend for the shell, in my case is cmd.exe, windows 8.1pro64bit).

I read the conemu's documentatione but still i find It very difficult :cry:

I've only come this far :oops: :

Command: %commander_path%\ConEmu\ConEmu64.exe

I couldn't pass to him neither the bat file nor the parameters (either by placing them in the Command field or by inserting them in the Parameters field).


Many thanks


edit: now it launches the bat file also,

Command: "%commander_path%\ConEmu\ConEmu64.exe" "%commander_path%\utils\test.bat"
Parameters: <empty>

but I don't get to pass the parameters (filenames) to test.bat :?
gdpr deleted 6
Power Member
Power Member
Posts: 872
Joined: 2013-09-04, 14:07 UTC

Post by *gdpr deleted 6 »

Two things. I am not a ConEmu user, but...

1. Put the path of the test.bat batch file in the parameters field. The batch file is a command line parameter provided to ConEmu64, no?

2. Read the ConEmu64 documentation of how to start programs/batch files plus parameters from ConEmu64 command line (https://conemu.github.io/en/ConEmuArgs.html). Hint: -run
Axis
Junior Member
Junior Member
Posts: 88
Joined: 2015-07-14, 18:53 UTC

Post by *Axis »

elgonzo wrote: 1. Put the path of the test.bat batch file in the parameters field. The batch file is a command line parameter provided to ConEmu64, no?
But the bat file is a command line paramater provided to cmd.exe also, and that works:
Command: cmd.exe /C ""%commander_path%\utils\test.bat""
Parameter: ?%F 20 8-10
elgonzo wrote: (https://conemu.github.io/en/ConEmuArgs.html). Hint: -run
I had already looked at that page, but is more complicated than it might seem.

Thanks
gdpr deleted 6
Power Member
Power Member
Posts: 872
Joined: 2013-09-04, 14:07 UTC

Post by *gdpr deleted 6 »

Okay. I agree, my 1st point was wrong :( (checked the TC help. Having parameters in the command field is permissible).

Anyway, if it is kind of complicated to figure out the correct command line for ConEmu, then i would suggest you experiment with the ConEmu command line and your batch file + parameters within a CMD window first. After you got a correctly working command line with ConEmu there, you can then take it over to your button definition. From the examples given in the documentation i linked to, it does not seem to be too complicated, though. (But then again, i don't use ConEmu, so i don't really know...)

The working command line should look something like that (according to the documentation):

Code: Select all

ConEmu64 -run "%commander_path%\utils\test.bat" <my_file> 20 8-10
(It could perhaps be necessary to run cmd to execute the batch files, similar to what the example running the command shows. But that is something you can easily figure out through experimentation...)

Just to make sure: How did you verify that no filename got passed to the batch file? Did you do an actual "echo %1" in the batch file?
Post Reply