|
-
May 14th, 2009, 08:59 AM
#1
Start / stop services as standard user
Hi again,
I am trying to find a way to spawn a process that will continue running once I log off.
A previous post ended up giving me a solution : services. I tried this out, and it solves
the problem as it was stated - the service continues to run when I log off.
However, I need Admin privileges to start / stop the service - which is not exactly the type of privileges my customers have.
Any ideas ?
Thanks
Andy
-
May 14th, 2009, 05:01 PM
#2
Re: Start / stop services as standard user
Start the service at boot up time, and let it run forever. Much like worker threads, program your service to sit idle, until a user logs in; launches a client program which will tell the service what to do; then the client can log out.
Viggy
-
May 15th, 2009, 01:59 AM
#3
Re: Start / stop services as standard user
Thank you Viggy,
I can install and start a service which will run forever.
However, I'm not sure how to make this service spawn another process upon a user's request, and be sure this process will not be killed when the user logs off.
Somewhere in the service I should have a call to ::CreateProcess (or similar), with something like ::CreateProcess(... "userexe.exe"...).
How do I ensure that "userexe.exe" will not be killed when the user logs off ?
Thank you again
Andy
-
May 15th, 2009, 11:54 AM
#4
Re: Start / stop services as standard user
I'm not familiar enough with Windows Services to answer your question, but can't you just have the service itself perform the work?
Viggy
-
May 15th, 2009, 01:03 PM
#5
Re: Start / stop services as standard user
Any process your service starts will not be killed when the user logs off. Keep in mind though, you cannot start a process from the service that has a GUI unless you get the current logged on users token etc and use CreateProcessAsUser(); thus whatever process your service kicks off will run in Session 0 I believe it is.
-
May 16th, 2009, 03:24 PM
#6
Re: Start / stop services as standard user
To run a process that is not designed to run service mode, with no user attendance, the user must use standard Switch User function but do not try to violate the very basic security principles.
Best regards,
Igor
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|