How can a Windows console application written in C# determine whether it is invoked in a non-interactive environment (e.g. from a service or as a scheduled task) or from an environment capable of user-interaction (e.g. Command Prompt or PowerShell)?
views:
343answers:
2
+4
A:
I haven't tested it, but Environment.UserInteractive looks promising.
Michael Stum
2009-07-27 15:00:14