【问题标题】:.bat file to open executable within Console2.bat 文件以在 Console2 中打开可执行文件
【发布时间】:2012-06-14 01:44:26
【问题描述】:

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

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

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

【问题讨论】:

  • 您查看过console.exe 命令行语法的文档吗?那里有任何线索吗?编辑:文档似乎不起作用...您必须查看我怀疑的来源

标签: batch-file console2


【解决方案1】:

好的,我查看了 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"。在那之后就像一个魅力。
【解决方案2】:

我从没听说过这个程序,但它是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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-08-19
    • 2013-07-31
    • 2018-09-07
    • 1970-01-01
    • 2011-03-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多