开发者

my console app in a batch file

my bat file:

myprogram.exe >> c:\temp\log.txt

my program is getting a null reference error but not sure why the message is not getting logged in log file. When i run manually in command wi开发者_运维技巧ndow i see the error.


Because >> is Standard Output and your error goes to Standard Error.

You can pass the error into Standard Output if you catch it and write it to Console


You can also have your batch file output stderr to a log file as well. Try

myprogram.exe >> c:\temp\log.txt 2> c:\temp\err.txt

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜