Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a service which is installed that runs and executes certain commands periodically. It runs as the Local System account. The source code for the service is not under my control, but I do control the Windows XP SP3 box that the service is on.

Recently, changes were made to the system that put a certain path at the forefront of the %PATH% for this service. One of the executables in that path has the same name as one of the commands my service uses, so the service mistakenly uses the wrong executable.

I need to change things back so that my service executes the right command. How do I modify the %PATH% so that the service will see it? I've already tried setx -m ... but with no luck.

share|improve this question
up vote 4 down vote accepted

The offending directory is specified either in the system-wide PATH environment variable, or in the Local System user's personal environment variables.

The Local System user's personal environment variables are specified at HKEY_USERS\.DEFAULT\Environment. The machine-wide environment variables are specified at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment. The former isn't really easily accessible from anywhere except the registry, but the latter is accessible from the Environment Variables dialog on the Advanced tab of the System Properties.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.