2012-06-14 37 views
14

Tôi đang hướng tới tạo trình khởi chạy .bat sẽ thực thi chương trình .exe trong dòng Console2.
đoán tốt nhất của tôi sẽ được rằng nó nên đi một cái gì đó như:.bat tệp để mở tệp thực thi trong Console2

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

nhưng tất cả những gì nó mở Console2.
Xin lưu ý rằng tất cả .bat và tệp thi hành đều nằm trong cùng một thư mục.

+1

bạn đã xem các tài liệu cho các cú pháp dòng lệnh console.exe không? Có manh mối nào không? Chỉnh sửa: Các tài liệu dường như không làm việc ... Bạn sẽ phải tìm trong nguồn tôi nghi ngờ –

Trả lời

18

Ok tôi nhìn vào nguồn cho Console.exe và đi sâu vào trợ giúp biên dịch.

Bạn cần một -r

Vì vậy: 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

hãy chắc chắn để thêm dấu ngoặc kép: -r "lệnh". đã làm việc như một sự quyến rũ sau đó. –

10

tôi chưa bao giờ nghe nói về chương trình này, nhưng nó source code

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

làm cho nó có vẻ như bạn có thể muốn thử:

Console.exe -r program.exe 
Các vấn đề liên quan