tags:

views:

146

answers:

1

Hi all.

I have a desktop application that installs and starts a service. I know a process can get the explorer.exe token and launch another process with that token so as the second process will run us the logged on useraccount.

My question is this: can I start my service by this explorer.exe token too? Is there an example in Delphi?

thx for your time

+3  A: 

No, you cannot use such a trick to launch a service in a specific user account. The service's configuration in the SCM specifies the user account that the service uses when started. You can use ChangeServiceConfig() to change that account, but be careful because it is a global setting, not a per-start setting.

Remy Lebeau - TeamB