Source: Microsoft Copilot, 7/25/2025

⚙️ Method 1: Using the GUI (System Properties)

  1. Open System Properties

  2. Go to Environment Variables

  3. Create or Edit Variables

  4. Input Details


💻 Method 2: Using the Command Line

✅ To set a variable for the current session:

set MY_VAR=C:\MyPath

🧱 To make it permanent (registry-based):

setx MY_VAR "C:\MyPath"

🧪 Bonus: Check If It’s Set

echo %MY_VAR%

Or use SystemPropertiesAdvanced.exe to visually confirm from the GUI.

Want to script this via PowerShell or roll it into a batch operation? I can help craft something precise for you.