1

私がやろうとしている

  call script.bat > script.log

ただし、結果はコンソールに表示されません。だから現在私はしなければならない

 call script.bat
 call script.bat > script.log

これは本当に非効率的です。

出力をコンソールに表示し、ログファイルに出力する方法はありますか?私はオプションの1つが

call script.bat > script.log
type script.log

しかし、script.batが長いバッチプロセスのステップの1つにすぎない場合は、実際には機能しません。すべての最後にタイプを1回実行するのではなく、呼び出されている各ステップの出力を確認したいと思います。呼び出し。

4

2 に答える 2

2

Windows Power-Shell を使用する場合 (windows タグを想定しているため)、Tee-Object というコマンドレットがあります。

help Tee-Object

NAME
    Tee-Object

SYNOPSIS
    Saves command output in a file or variable and displays it in the console.

Unixでは、同じ機能を提供するプログラムティーがあります。

于 2012-12-03T23:11:58.023 に答える
0

できません。

オプション1:

call "script.bat" > "script.log" | type "script.log"

オプション2:

wintee http://code.google.com/p/wintee/

于 2012-12-03T23:26:19.130 に答える