Windows 7 - User-specific %PATH%

83,541

It looks like you're trying to modify the system path so it's dynamic per-user.

You can set environment variables on a per-user basis, so this isn't necessary.

via the registry;

HKEY_CURRENT_USER\Environment

via the ui;

UI screenshot

Admittedly such an approach falls down once you add more users, but on a home system this probably isn't a frequent occurrence.

Share:
83,541

Related videos on Youtube

Henrique Zacchi
Author by

Henrique Zacchi

Updated on September 17, 2022

Comments

  • Henrique Zacchi
    Henrique Zacchi over 1 year

    I'd like to set up a system for Windows 7 where each user has their own private directory in %PATH%. I tried setting %PATH% to %HOMEDRIVE%%HOMEPATH%\Bin;%SystemRoot%\System32;[...] but it doesn't seem to work.

    For those who don't realize what I'm trying to do, it's sort of like EXPORT PATH=~/bin would be on *nix. It can be on a user specific basis if need be (and that would actually be prefer to the machine-wide settings).

  • Henrique Zacchi
    Henrique Zacchi about 14 years
    You can add the variables on the per-user basis, but will this override the system %PATH%?
  • RJFalconer
    RJFalconer about 14 years
    It will add to the system path.
  • Vince
    Vince over 10 years
    There are two problems with this method. First, as you stated, it's impractical on a system with more users. The second problem is that the PATH variable, unlike other variables, is appended to the system path. It looks like there's no way to set system variables in a dynamic way :( This also answers @MiffTheFox 's question.
  • m-r-r
    m-r-r over 9 years
    @Ghodmode You can simply set the user's PATH to something like %PATH%;C:\your\path : On Win 7, the variables are expanded and my path is appended to the system's path. Also, you can run rundll32 sysdm.cpl,EditEnvironmentVariables to show the dialog. I haven't tested on other versions, though.