Processes launched by WinService in different user session
Posted on 2011-03-09
I have a Windows 'monitoring' Service written in C# which is intermittently required to relaunch executables.
I am using a Process.Start(myProcessStartInfoObj) with passed arguments which works fine with regard to actually starting the processes, however the problem I am experiencing is that the processes' icons do not appear on the task bar and...
(1) the processes are not shown by default in Win 7 (whereby the relaunched processes are launched under a different session (SYSTEM) rather than under the logged-in user (admin) account).
(2) the applications do not appear in Task Mgr on Win XP.
If I make exactly the same method call from a WinForm app, the icons appear in the taskbar OK, and the processes appear in Task Mgr OK too (on both flavours of OS).
I have tried changing the 'Logon' params associated with the Service from Local System Account to 'This account' with no success.
Do I need to specify some additional info in myprocessStartInfoObj param to get around this (and get my icons and TaksMgr applications displayed)?
Thanks for any advice.