在Console2中打开可执行文件的.bat文件

14

我打算创建一个.bat启动器,用于在Console2中执行命令行.exe程序。
我的最佳猜测是应该像这样进行:

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

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


1
你看过console.exe命令行语法的文档了吗?那里有什么线索吗?编辑:文档似乎不起作用...我猜你得查看源代码。 - Preet Sangha
2个回答

19

好的,我查看了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. 

请确保添加引号:-r "command"。之后运行得非常好。 - Bobby Tables

10

我之前从未听说过这个程序,但它的源代码

   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

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接