将windows控制台内容输出到文件中 将windows控制台内容输出到文件中 dir>c:/file.txt 2>&1 对应的java class >c:/file.txt 2>&1 或 a.exe >log.txt 2>&1