linux and windows tips, mathematics, and some recipes

Friday, January 13, 2006

Tweaking the Acer - Part III, ePowerManagement continued

In Part II, we discussed how to get Acer ePowerManagement working for ordinary non-privileged users. Well, half-working at least. To go the extra distance, we need to make further changes. As well as the "Access denied" messages, you may also find that ePowerManagement stops if you log out and doesn't restart when you log in again. To fix these problems, we'll give the user the ability to start and stop the service at will, and then write a script to perform these operations.

First, you need to download subinacl from the Microsoft website. Having done this, run the following command:
subinacl /service epowermanagement /grant=billybob=STOP
where billybob is your username. This gives billybob the right to query, start, stop, and pause/continue the service.

Go back to the Service configuration tool. Right-click on epowermanagement and select properties. Change the Startup type to Manual. This means that the service won't be started automatically on bootup, but will be started only when called upon.

Now we need to write a script which will call the service. Create a file epm.bat in your home directory (or wherever). Type the following into the file:
@echo off
%windir%\system32\sc.exe stop epowermanagement
%windir%\system32\sc.exe start epowermanagement
Copy this file in your Startup folder. The simplest way to do this is to first copy the icon for epm.bat, then right-click on the start menu button and choose open. Navigate to the Startup folder and paste the file. This should do the trick, though you may want to log out and log back in again to get the full effect.

For further information on running applications as a non-privileged user, read the non-admin wiki, and Aaron Margosis' Weblog.


Post a Comment

<< Home