2012-06-14 67 views
14

我打算创建一个.bat启动程序,该程序将在Console2内执行命令行.exe程序。
我最好的猜测是,它应该是这样的:.bat文件在控制台2中打开可执行文件

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

但所有的它打开Console2。
请注意,所有.bat和可执行文件都在同一个文件夹中。

+1

你看的文档的console.exe的命令行语法?那里有任何线索?编辑:文档似乎并没有工作...你必须看看源我怀疑 –

回答

18

好吧,我看着来源为Console.exe并深入到编译的帮助中。

你需要一个-r

所以: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. 
+0

一定要加引号:-r“命令”。之后就像一个魅力工作。 –

10

我从来没有听说过这个节目,但其source code

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

使它看起来就像你可能会想尝试:

Console.exe -r program.exe