2012-05-11 3 views
0

対話型のJavaからバッチファイルを呼び出すのに助けが必要です。新しいウィンドウで開くべきではありません。ランタイム--- cmd/c start batchfilename ---を使用して呼び出しを試みましたが、新しいウィンドウで開きます。呼び出し元のバッチファイルを呼び出し元のウィンドウと同じウィンドウにフォーカスして実行する必要があります。Javaからインタラクティブなバットファイルを実行していますか?

+0

'Runtime'を実行するプログラムのコードを記述してください。 –

答えて

1

Windowsが起動コマンドがあります。

C:\>start /? 
Starts a separate window to run a specified program or command. 

START ["title"] [/D path] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED] 
     [/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL] 
     [/AFFINITY <hex affinity>] [/WAIT] [/B] [command/program] 
     [parameters] 

    "title"  Title to display in window title bar. 
    path  Starting directory 
    B   Start application without creating a new window. The 
       application has ^C handling ignored. Unless the application 
       enables ^C processing, ^Break is the only way to interrupt 
       the application 
    I   The new environment will be the original environment passed 
       to the cmd.exe and not the current environment. 
    MIN   Start window minimized 
    MAX   Start window maximized 
    SEPARATE Start 16-bit Windows program in separate memory space 
    SHARED  Start 16-bit Windows program in shared memory space 
    LOW   Start application in the IDLE priority class 
    NORMAL  Start application in the NORMAL priority class 
    HIGH  Start application in the HIGH priority class 
    REALTIME Start application in the REALTIME priority class 
Press any key to continue . . . 

がスタート(とないCMD)を実行するようにしてください。それが役に立たなければ、ユーザーの入出力を捕捉してProcessにパイプすることができます。

関連する問題