I only would like to call
Process.Start("notepad.exe");
when the service starts; But it doesn’t work at all. No notepad is called right after I chose to start the service in the windows service manager.
Thank you a lot.
[UPDATE]
I made it work after putting a check mark in logon tab to allow interactive desktop. But I don’t know what does this really mean ? How can I schedule to run a task on any computer if it always asks me to accept to view the message in the Interactive Desktop Detection panel ?
A Windows service is different from a standard process and by default it can’t interact with the user desktop(this is a rule of the Windows OS), so to launch a process and allow it to interact with the user desktop you have to flag the Interact with desktop option …
Bear in mind that starting from Windows Vista services are running under session 0 and every time that the service try to start the process a panel is shown to the user the let the user choose if he wants to run the process or not; to overcome this limitation (panel that ask for confirmation) the only way is to launch the process from the service directly with the CreateProcessAsUser function of the Windows API …
Take a look at this function that i have developed some times ago, that make use of the CreateProcessAsUser API, and start a process from a service without asking anything even in Vista/7: