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

时间:2012-06-14 01:44:26

标签: batch-file console2

我的目标是创建一个.bat启动程序,它将在Console2内执行命令行.exe程序。
我最好的猜测是它应该是这样的:

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

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

2 个答案:

答案 0 :(得分: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. 

答案 1 :(得分: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
相关问题