windows service to lunch windows application

G

Guest

Hi,

I have a windows service developed using c# and it needs to lunch another
windows application. I have been trying to use Process class to do it but the
problem is becase windows service running at background and using system
account, so the applcation it lunchs is also running at the background. is
there a way to lunch the windows application as current logged in user?

Thanks
 
S

Sriram Krishnan

No offence - but I read your post and muttered to myself "Man..there's
another term I have to look up.What does lunching a service mean". :)
 
E

Elp

Michael said:
I have a windows service developed using c# and it needs to lunch
another windows application. I have been trying to use Process class
to do it but the problem is becase windows service running at
background and using system account, so the applcation it lunchs is
also running at the background. is there a way to lunch the windows
application as current logged in user?

Not really. A Windows Service has by default no access to the currently
logged in user's desktop. This is because it runs regardless of the logged
in user and even if no user is logged in.

However, if you open the Services control panel and go to the properties
page of your service, you will be able to allow it to interact with the
user's desktop. This should allow you to start a Windows application with
the Process class. Note that the application will not run under the logged
in user's account but under your windows service's account (by default Local
System). This poses big security issues and is not recommended. If you do
that you will also certainly run into problems if you try to start a Windows
application while nobody is logged in Windows.

In short: you'd better find another way to do what you want to do than
trying to start a Windows application from a Windows service. What about
placing a shortcut to the needed Windows application in the Startup folder
so that it would be launched automatically each time a user logs in?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top