-
September 30th, 2010, 07:33 AM
#1
Make Windows Service Unable to Terminate?
Hey,
I'm working on a Windows Service application and i want this service to be 'unable to terminate' process, so when i go to the Windows Task Manager and i click on terminate on the process, its sais unable to terminate.
Thanks,
Dan
-
September 30th, 2010, 12:06 PM
#2
Re: Make Windows Service Unable to Terminate?
R.I.P. 3.5" Floppy Drives
"I know not with what weapons World War III will be fought, but World War IV will be fought with sticks and stones." - Albert Einstein
-
September 30th, 2010, 12:43 PM
#3
Re: Make Windows Service Unable to Terminate?
This is what i need, but i dont understand where to use it and how?
-
September 30th, 2010, 01:02 PM
#4
Re: Make Windows Service Unable to Terminate?
Try this.
Code:
public partial class MyService : ServiceBase
{
public MyService ()
{
InitializeComponent();
CanStop = false;
CanShutdown = false;
}
}
If it doesn't work, you'll have to load the service under a different account ( maybe 'LocalSystem'? ).
-
September 30th, 2010, 01:06 PM
#5
Re: Make Windows Service Unable to Terminate?
Ok, it acctually work but it doesn't exectly what i ment.
Now i cant stop the service from the Services window in Windows, but i can still do CTRL+ALT+DELETE go to Process and kill it ...
any ideas?
-
September 30th, 2010, 02:10 PM
#6
Re: Make Windows Service Unable to Terminate?
Originally Posted by danpe
Ok, it acctually work but it doesn't exectly what i ment.
Now i cant stop the service from the Services window in Windows, but i can still do CTRL+ALT+DELETE go to Process and kill it ...
any ideas?
See my previous comment:
If it doesn't work, you'll have to load the service under a different account ( maybe 'LocalSystem'? ).
To determine which account, identify a service that you know you can't kill with task manager, open it up in the services control applet and see which startup account is used for that service (and use the same for that service).
-
September 30th, 2010, 02:23 PM
#7
Re: Make Windows Service Unable to Terminate?
My service is on the SYSTEM, and the process i cant close is on the 'owner' thats the user im logged with...
When im trying to close the process i cant close its sais "Unable to Terminate Process The operation could not be completed. Access is denied"
Last edited by danpe; September 30th, 2010 at 02:29 PM.
-
October 2nd, 2010, 10:20 PM
#8
Re: Make Windows Service Unable to Terminate?
Originally Posted by danpe
My service is on the SYSTEM, and the process i cant close is on the 'owner' thats the user im logged with...
When im trying to close the process i cant close its sais "Unable to Terminate Process The operation could not be completed. Access is denied"
One way around this is to create a specific machine account and give it the appropriate permissions.
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
|