Disable service for a specific user account in Windows XP

1

1

How can I disable a service in Windows XP for a specific user account?

I have Tomcat and DB2 which I'm using as an administrator, but I don't need them as a plain user.

Furthermore, since that account does not have privileges on some files, services are failing to start and showing annoying errors repeatedly.

I tried using services.msc, but those settings seem to be global, and I can't change them from non-admin account.

celicni

Posted 2012-05-09T12:54:20.893

Reputation: 105

In short, the service settings seem to be global because services are global. – user1686 – 2012-05-09T13:19:24.420

Answers

2

You cannot disable services on a per-user basis since services run independent of the logged in user. The best you can do is to stop the service automatically when the normal user logs in. You can do this with a batch script:

net stop <servicename>

Since the user probably doesn't have permission to stop services, you'll want to add a scheduled task, configure it to run at the specified user's logon, and to run as an administrator (or other user with sufficient privileges).

If there are multiple normal users, you'll need to add this scheduled task for all of them, and then probably one that starts the services for the administrator.

For more information on net stop and net start:
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/net_stop.mspx?mfr=true
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/net_start.mspx?mfr=true

Indrek

Posted 2012-05-09T12:54:20.893

Reputation: 21 756

2

You could take one of the above solutions a step farther. I like the scheduled task idea. If you're comfortable with VbScript (or any programming language really) you could write a script to identify who is logged in and then shell the "net stop " depending on whether they were in the administrator group (or as a quick but less flexible way you could say if they're not your user account).

Here's a rough draft of a script that I just copied and pasted together that would probably work:

Dim objNetwork
Set objNetwork = CreateObject("WScript.Network")

If objNetwork.UserName <> "YourAccountUsername" Then
    ' If they're not you, send the shell command to stop the service.
    Dim objShell
    Set objShell = WScript.CreateObject("WScript.Shell")     
    objResult = objShell.Run("net stop <service name>", 1, True) 
End If

b.pell

Posted 2012-05-09T12:54:20.893

Reputation: 286

1

Services are machine-wide. There is no concept of which user is currently logged into the workstation with regards to services. I believe Tomcat can be started under a user's profile (as in... a shortcut can possibly be used to start the process running) ... but I doubt DB2 will work in user-space.

TheCompWiz

Posted 2012-05-09T12:54:20.893

Reputation: 9 161

1

It is not possible to stop the services according to user base. The services are the part of the running OS which it required the most and the programs also use the services at the time of launch which they need. You can only stop the services which are running by you manually not from the system but if you try to stop the service that required by the system it will not let you do and by the way its happen in any case OS will crash.

Services are like the limbs of the body which can stop for the certain time but when you will need it you have to active that part of the body and since there are many things you can't control like heart beat. Its depend on the system that how many and which services it needs to run.

avirk

Posted 2012-05-09T12:54:20.893

Reputation: 15 151