user variable PATH reset

  • Thread starter Thread starter Peter_W_Levine
  • Start date Start date
P

Peter_W_Levine

Hi,

I can set a user variable named PATH from the Control Panel. I verify
that it works; my program executes. However, my changes are gone when I
logoff/login. A different user variable I have defined is still there
and OK. Only my user variable PATH is reset. Is there something special
about this user variable that doesn't survive logouts? Is there some
way to work around this -- I don't want to have to set it every time I
log in.

Thanks,
Pete
 
Try this:

User variable name: PATH
User variable value: %PATH%;C:\user\defined\path

Logout and log back in and you can veify if variable is still set by opening
CMD and type command: echo %PATH%
 
Are you trying to add PATH under User Variables in System Properties |
Advanced | Environment Variables button?

Try adding to PATH under System Variables.

If you are not logged on as administrator to the local computer, the only
environment variables you can change are user variables.

PATH is normally a System Variable.

PATH is stored here...

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session
Manager\Environment
Value Name: Path
Data Type: REG_EXPAND_SZ
Value Data: What you see when you type PATH in a command prompt.

As a matter of fact, all System Variables are in the above key.

Make sure that PATH is REG_EXPAND_SZ and not REG_SZ.

TMP & TEMP, User Variables for User Name, are in
HKEY_CURRENT_USER\Environment

[[System Variables
You must be an administrator to modify a system environment variable. System
environment variables are defined by Windows and apply to all computer
users. Changes to the system environment are written to the registry, and
usually require a restart to become effective.

User Variables for User Name
Any user can add, modify, or remove a user environment variable. These
variables are established by Windows XP Setup, by some programs, and by
users. The changes are written to the registry, and are usually effective
immediately. However, after a change to user environment variables is made,
any open software programs should be restarted to force them to read the new
registry values. ]]
from...
How To Manage Environment Variables in Windows XP
http://support.microsoft.com/default.aspx?scid=kb;en-us;310519


--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
 
I do not have adminstrator rights. I found the problem. An admin script
is setting the value of the user variable PATH and is writing over my
values. I can't get the admin to change their script so can I run my
own .bat at startup to change PATH=%PATH%; my_path? How do I get a
..bat script to run at startup? (Sorry if this too newbie -- I'm a UNIX
guy).

Thanks,
Pete
 
How do I get a .bat script to run at startup?

Place a shortcut to your .bat file in
C:\Documents and Settings\All Users\Start Menu\Programs\Startup
or %allusersprofile%\Start Menu\Programs\Startup

or
C:\Documents and Settings\Your Name Here\Start Menu\Programs\Startup
or %userprofile%Start Menu\Programs\Startup

%allusersprofile% is an environment variable that is the path to the All
Users folder.

Typing or pasting %allusersprofile% into the Start | Run box opens to the
Documents and Settings\All Users folder on whatever drive it is located on.

I.e. C:\Documents and Settings\All Users

%userprofile% is an environment variable that is the path to the user's home
folder.

Typing or pasting %userprofile% into the Start | Run box opens to the
Documents and Settings folder on whatever drive it is located on for the
logged in user.

I.e. C:\Documents and Settings\Your Name Here

All of this depends on whatever policies the "admin" has in place. My
original post did not take into account the fact that your were *NOT* on a
standalone machine.

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top