7

I have a command line tool that typically dumps out about 200+ lines of output. I'm looking for text that appears at the end of this output. When I redirect the output to a file:

C:\> somecommand > results.txt 2>&1

...only the first 100 or so lines of output shows up in this file. Likewise, if I pipe the output into something like 'findstr', the receiving program is unable to find or operate on any text after about the 100th line.

The screen buffer size settings for the shell appear to have no effect whatsoever on the number of lines that can be captured.

Any ideas what is going on here? For what it's worth, the command in question is iscmdbld.exe from InstallShield 2012.

This problem does not occur with other commands I've tried (such as 'dir').

The full output from the program can only be viewed when running the command within a cmd window.

4

4 に答える 4

3

残念ながら、私は InstallShield をインストールしていないので、テストを実行するのは非常に困難ですが、入力と出力の処理に関して、本来の動作をしていないプログラムに遭遇しました。通常、">"​​ には制限はありません。バックグラウンドで Ghostscript やその他の古い dos プログラムを実行している Windows サーバーでよく使用しています。出力をファイルにパイプする唯一の方法は、> を使用することです。 、時々私はかなりのメガバイトのファイルを持っているので、200行は実際に現在のexeで何かをしなければなりません.

たとえば、tee32 を試すことができます。これは、すべての dos 画面出力をファイルにキャプチャする小さなフリーウェアです。したがって、画面に出力が表示され、ファイルにも出力されます。

あなたはそれについてもっと読むことができます:ここで残念ながらページに記載されているリンクは機能していませんが、私はそれの作業コピーを見つけることができました:ここ

これが問題を克服するのに役立つことを本当に願っています。

エミル

于 2014-02-16T15:26:52.510 に答える
1

別のストリームに書き込んでいる場合は、これを試してください:

somecommand > results.txt 2>&1 3>&1 4>&1 5>&1 6>&1 7>&1 8>&1 9>&1

もう 1 つの可能性は、ツールが出力の一部にダイレクト スクリーン ライトを使用している可能性です。MSDOS の時代には、役立つスクリーン リーディング TSR プログラムがありました。

于 2014-02-15T19:28:42.047 に答える
0

もう 1 つの方法は、新たに開始する ('>') のではなく、追加する ('>>') ことです。ただし、問題について詳しく知らずに、表示されているものを生成する方法さえ考えられません。

于 2014-02-13T00:13:01.253 に答える