1

As the question states, I have some variables defined in my user environment in windows 8.1. Now I want to have something like this as a path:

C:\Program Files (x86)\Intel\iCLS Client\;%USER_V1%;C:\Program Files\Intel\iCLS Client\;%USER_V2%;...

Where USER_V[1, 2] refer to some user defined variables

Reason why I want this is so that if I modify the user variable (like change their value), the change is reflected in the path variable; and I don't have to go and modify the path variable manually (I'm lazy that way)

I'm not sure if this is possible, but maybe someone can provide a solution.

Thanks,

  • Are you looking to administrate just your workstation locally, or do you have a need to perform this task remotely as well? – Sun Sep 18 '14 at 4:05
2

Yes, this can definitely be done. I will provide steps for Windows XP, but the solution is applicable to newer OS (Vista, Win 7) with slight changes in navigation.

You have to set the environment variable as a system variable. You can not set it as a user variable because PATH is loaded as part of the system variables. Since %USER_V1% and %USER_V2% are included in PATH, you have to create them as system variables.

In my example, I am creating a system variable called dropbox with a value of e:\dropbox\apps\cli . These are where all my command line utilities are located:

Go to Control Panel > System > Advanced > Environmental Variables

Environmental Variables

Create a new system variable. In your case, it would be USER_V1 and USER_V2

New System Variable

Once you have created USER_V1 and USER_V2, you need to edit your PATH system variable and append them to the PATH. Remember that you need to surround user/system variables with a percent sign (e.g. %dropbox%)

append path

Now go to a command prompt and type SET. You should see your new dropbox variable, and your system variables in your PATH completely spelled out:

SET path

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.