14

I am aiming to create a .bat launcher that will execute a command line .exe program within Console2.
My best guess would be that it should go something like:

@echo off
start "" Console.exe program.exe

but all that does it open Console2.
Please note that all .bat, and executables are all in the same folder.

Eitan T
  • 32,660
  • 14
  • 72
  • 109
Switchkick
  • 2,716
  • 6
  • 21
  • 28
  • 1
    Have you looked the docs for console.exe's command line syntax? Any clues there? Edit: The docs don't seem to work... You'll have to look in the source I suspect – Preet Sangha Jun 14 '12 at 01:54

2 Answers2

19

Ok I looked in source for the Console.exe and drilled down into the compiled help.

You need a -r

So: Console.exe -r program.exe

Command line parameters

Console supports these command line parameters: 

-c <configuration file>
     Specifies a configuration file. 


-w <main window title>
     Sets main window title. This option will override all other main window title settings (e.g. 'use tab titles' setting) 


-t <tab name>
     Specifies a startup tab. Tab must be defined in Console settings.


-d <directory>
     Specifies a startup directory. If you want to parametrize startup dirs, you need to specify startup directory parameter as "%1"\ (backslash is outside of the double quotes) 


-r <command>
     Specifies a startup shell command. 


-ts <sleep time in ms>
     Specifies sleep time between starting next tab if multiple -t's are specified. 
Preet Sangha
  • 64,563
  • 18
  • 145
  • 216
10

I'd never heard of this program, but its source code

   else if (wstring(argv[i]) == wstring(L"-r"))
             {
                     // startup cmd
                     ++i;
                     if (i == argc) break;
                     startupCmds.push_back(argv[i]);
             }

makes it seem like you might want to try:

Console.exe -r program.exe
Chris Stratton
  • 39,853
  • 6
  • 84
  • 117