Create new system variable available without restart

A common question!

In Windows, you can create a new system variable without restarting your computer. Here's how:

Method 1: Using the System Properties

  1. Press the Windows key + Pause/Break to open the System Properties window.
  2. Click on the "Advanced" tab.
  3. Click on the "Environment Variables" button.
  4. Under "System Variables", click "New".
  5. Enter the name of the new variable in the "Variable name" field.
  6. Enter the value of the new variable in the "Variable value" field.
  7. Click "OK" to close all the windows.

Method 2: Using the Command Prompt

  1. Open the Command Prompt as an administrator. You can do this by right-clicking on the Start button and selecting "Command Prompt (Admin)".
  2. Type the following command and press Enter:
    setx NEW_VARIABLE_NAME "NEW_VARIABLE_VALUE"

    Replace NEW_VARIABLE_NAME with the name of the new variable and NEW_VARIABLE_VALUE with the value of the new variable.

For example:

setx MY_NEW_VAR "Hello World"

This will create a new system variable named MY_NEW_VAR with the value "Hello World".

Method 3: Using the Windows Settings App

  1. Open the Windows Settings app by searching for "Settings" in the Start menu.
  2. Click on "System" and then click on "About".
  3. Click on the "Advanced system settings" link on the right side of the window.
  4. Click on the "Environment Variables" button.
  5. Under "System Variables", click "New".
  6. Enter the name of the new variable in the "Variable name" field.
  7. Enter the value of the new variable in the "Variable value" field.
  8. Click "OK" to close all the windows.

Once you've created the new system variable using any of these methods, you can verify that it's been created by opening a new Command Prompt window and typing echo %NEW_VARIABLE_NAME%. If the variable was created successfully, you should see the value you specified.