开发者

Redirect stdout and stderr in Windows Service

开发者 https://www.devze.com 2023-02-14 11:43 出处:网络
I created开发者_如何学Python a windows service that can execute processes exposed via wcf (internal use only).I recently ran into an issue where this works fine if I execute the process (cmd.exe) dire

I created开发者_如何学Python a windows service that can execute processes exposed via wcf (internal use only). I recently ran into an issue where this works fine if I execute the process (cmd.exe) directly, but when installed to run as LOCALSYSTEM, output and error redirection didn't work. After a day or so, I figured out that if I also redirect stdin, things work fine. I found a related thread here, but no real resolution.

Anyway, I was wondering if anyone knows the reason for this and are there known issues with output in Windows Services?

One complication is that I recently installed W7 SP1, so I'm not sure if this changed the behavior or not since I haven't had a chance to uninstall and try again.


The standard streams are only available to processes that are running interactively. Windows Services do not run in interactive mode.

0

精彩评论

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