System.setOut(new PrintStream(new FileOutputStream("c://test.txt")));

解决方案 »

  1.   

    sorry, 以上是在程序中你的问题是启动的时候利用管道 > test.txt
    就可以了如
    %SystemRoot%\system32\cmd.exe /k "C:\bea\weblogic700\samples\server\config\examples\startExamplesServer.cmd"变成%SystemRoot%\system32\cmd.exe /k "C:\bea\weblogic700\samples\server\config\examples\startExamplesServer.cmd > c:\test.txt"
      

  2.   

    是在CMD窗口直接打以上命令吗
      

  3.   

    还可以将标准输出和错误输出分开写
    startWebLogic.cmd 1>stdout.log 2>stderr.log