3
Reply

running CommandPrompt from a Windows Service

Tracy Baird

Tracy Baird

Nov 3 2009 11:59 AM
4.8k
I have a Windows Service that will create a Process object and fire the command prompt with a specific command. The problem I am having is that apparently the command prompt is trying to open a window and I am getting the following error: Error: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application. (System.InvalidOperationException) Can anyone help me to make this fire in the background using a windows service or do I have to go another way?

Answers (3)