cmd.exe equivalent of /dev/stdout, to write to stdout 'as a file'

时光毁灭记忆、已成空白 提交于 2021-02-05 06:31:42

问题


I have a batch file that calls a Windows GUI application. The GUI app writes it's output (the interesting bits anyway) to it's own GUI display rather than stdout, however I would like it displayed in the cmd window where the batch file is running.

Thankfully the app has an option to write the output to a file, so I need to redirect this to stdout. In *nix I would give /dev/stdout as the file to write to but what about in Windows/cmd?


回答1:


It seems that Windows has no equivalent to unix /dev/stdout.

Take a look at this thread: https://superuser.com/questions/241272/windows-how-to-redirect-file-parameter-to-stdout-windows-equivalent-of-dev-st




回答2:


con is the equivalent of /dev/stdout and /dev/stderr in Windows. But I am not sure how you are writing the output. It will help if you could paste the block that writes to the file.



来源:https://stackoverflow.com/questions/7284174/cmd-exe-equivalent-of-dev-stdout-to-write-to-stdout-as-a-file

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!