如何将命令提示符的输出重定向到 Windows 上的 DebugView?
我的想法是类似
C:\myprog.exe > DebugView
,但我希望 DebugView 捕获 myprog.exe 的输出,而不是创建名为“DebugView”的文件。
任何评论都将受到高度赞赏!
My idea is something like
C:\myprog.exe > DebugView
but instead of creating a file named "DebugView", I would like the output of myprog.exe to be captured by DebugView.
Any comment is highly appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
正如 David Heffernan 上面所解释的,您需要通过另一个程序发送输出,该程序的任务是使用
OutputDebugString
将所有标准输入转换为调试输出,如 linuxuser27 所指出的。但是,我不知道有任何现有的程序可以完成此类任务。您可以使用以下简单的 C# 程序来执行此操作:如果将其编译为例如
StdinToDebug.exe
,则可以使用提到的As David Heffernan explained above, you need to send the output through another program, whose task is to convert all standard input to debug output using
OutputDebugString
, as linuxuser27 noted. However, I am not aware of any already existing program for such a task. You might use the following simple C# program to do that:If you compile it to e.g.
StdinToDebug.exe
, you can use the mentioned我相信您正在寻找的是 OutputDebugString()
I believe what you are looking for is OutputDebugString()
您需要通过管道传输它而不是重定向它:
当然,DebugView 需要从标准输入读取才能正常工作。
You need to pipe it rather than redirect it:
Of course, DebugView needs to read from standard input for this to work.