Windows批处理脚本:重定向所有输出到文件 [英] Windows Batch Script: Redirect ALL output to a file
问题描述
我运行各种Java基准测试,并想归档的结果。我执行(DACAPO)基准测试是这样的:
I am running various Java benchmarks and would like to archive the results. I execute the (dacapo) benchmark like this:
C:\VM\jre\bin\java -jar C:\benchmarks\dacapo-9.12-bach.jar %arg1% > %time::=%
我通过基准的类型,在一个参数,那是什么ARG1%%的。
I pass the type of benchmark in over a parameter, thats what %arg1% is.
您可以看到,我将输出重定向到一个文本。不幸的是,输出的第一行和最后一行仍然印在控制台而不是到文本:
You can see that I am redirecting the output to a textfile. Unfortunately, the first and last line of the output is still printed in the console and not into the textfile:
===== DaCapo 9.12 luindex starting =====
===== DaCapo 9.12 luindex PASSED in 2000 msec =====
有在文本文件中
尤其是最后一行将是重要的:)
Especially the last line would be important to have in the text file :)
有没有窍门,迫使这种行为?
Is there a trick to force this behavior?
推荐答案
您必须重定向输出和错误。
You must redirect STDOUT and STDERR.
命令>日志文件2 - ;&放大器; 1
这篇关于Windows批处理脚本:重定向所有输出到文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!