An environment variables is a short reference to an object in the system. Using such abbreviations, for example, you can create universal paths for applications that will run on any PC, regardless of user names and other parameters.
In many situations, it’s necessary to set application specific environment variables for testing and debugging purposes. These kind of variables are exclusive to the application and will be dead when the application exits. For example, suppose if you've a rendering application in which the rendering path is specified as environment variable. Sometimes it might be necessary to change these variables for testing or in some situations you may need to add or delete the existing one. In most cases, the application specific variables are controlled launching through script files after setting up necessary variables or by a launcher application (Environment variables are inherited from Parent Process). Still dynamically updating variables is out of our reach.
You can get information about existing variables in the system properties. From the Control Panel, open the System applet or right click mouse button on the Computer shortcut on the desktop and select the Properties
Select the Advanced tab.
In the opened window with the tab "Advanced" we press the button indicated in the screenshot below (Environment Variables button).
Click the New button under the User variables or System variables box depending on whether you want to create an environment variable that is visible only to the currently logged-on user or system-wide.
Enter the variable name and value and click OK until all windows are closed.
cmdor just start typing command after opening the Start menu.
To view environment variables, run the set command. You can also view a subset of environment variables by running set and specifying the first letters of the variable(s). This command displays all environment variables that begin with USER:
You can use the wmic utility to print environment variables on a remote system:
You can print the value of an environment variable using echo:
To set an environment variable for use in the current CMD session, use the set command. The following command sets the FOOBAR environment variable:
Also consider using Action1 to set environment variables if: