Ved at bruge denne side, du accepterer Privatlivspolitik.
Acceptere
EnterineEnterineEnterine
  • HJEM
  • Det pro
  • Teknik
  • Microsoft
    • Azurblå
    • Configmgr/SCCM
    • DPM
    • Orkester
    • Hyper-V
    • Microsoft Edge Insider
    • MSI
    • Kontor 365
    • Office Insider
    • Power BI
    • Skype
    • SQL Server
    • Hold
  • Windows
    • Windows Admin Center
    • Windows klient
    • Windows Server
  • SCCM-forespørgselsindsamlingsliste
Læsning: PowerShell add Windows PATH variable using setx
Font ResizerAa
EnterineEnterine
Font ResizerAa
  • HJEM
  • Det pro
  • Teknik
  • Microsoft
  • Windows
  • SCCM-forespørgselsindsamlingsliste
Søge
  • HJEM
  • Det pro
  • Teknik
  • Microsoft
    • Azurblå
    • Configmgr/SCCM
    • DPM
    • Orkester
    • Hyper-V
    • Microsoft Edge Insider
    • MSI
    • Kontor 365
    • Office Insider
    • Power BI
    • Skype
    • SQL Server
    • Hold
  • Windows
    • Windows Admin Center
    • Windows klient
    • Windows Server
  • SCCM-forespørgselsindsamlingsliste
IT Pro

PowerShell add Windows PATH variable using setx

Offentliggjort: februar 18, 2024
2 Min læst
DELE

PowerShell add Windows PATH variable using setx.

Run Powershell as Administrator

setx /M PATH "$Env:PATH;"

To verify

$Env:PATH

NOTE: In Windows 10 unless ‘/m’ is the very first argument rather than the last, the variable is set in the logged-in user’s context not the machine’s.

Remarks

  • De Setx command is similar to the UNIX utility SETENV.
  • Setx provides the only command-line or programmatic way to directly and permanently set system environment values. System environment variables are manually configurable through Control Panel or through a registry editor. De set command, which is internal to the command interpreter (Cmd.exe), sets user environment variables for the current console window only.
  • You can use the setx command to set values for user and system environment variables from one of three sources (modes): Command Line Mode, Registry Mode, or File Mode.
  • Setx writes variables to the master environment in the registry. Variables set with setx variables are available in future command windows only, not in the current command window.
  • HKEY_CURRENT_USER og HKEY_LOCAL_MACHINE are the only supported hives. REG_DWORD, REG_EXPAND_SZ, REG_SZ, and REG_MULTI_SZ are the valid RegKey data types.
  • When you gain access to REG_MULTI_SZ values in the registry, only the first item is extracted and used.
  • You cannot use the setx command to remove values that have been added to the local or system environments. You can use set with a variable name and no value to remove a corresponding value from the local environment.
  • REG_DWORD registry values are extracted and used in hexadecimal mode.
  • File mode supports the parsing of carriage return and line feed (CRLF) text files only.
TAGGET:PowerShellWindowsWindows 10
Forrige artikel How to Stop a Stuck Hyper-V Virtual Machine
Næste artikel New features announced for Office 365 for 2019/20
Efterlad en kommentar Efterlad en kommentar

Efterlad et svar Annuller svar

Din e-mailadresse vil ikke blive offentliggjort. Påkrævede felter er markeret *

Denne side bruger Akismet til at reducere spam. Lær, hvordan dine kommentardata behandles.

Oversættelse

English中文(简体)DanskNederlandsFrançaisDeutschItaliano한국어PolskiPortuguêsRomânăEspañolУкраїнська
ved Transposh - translation plugin for wordpress

Populære indlæg

Systemkrav til Windows Server 2016
Windows Server
Configuration Manager Forespørgselsindsamlingsliste
Configuration Manager Forespørgselsindsamlingsliste
Configmgr
Struktureret/administreret navigation aktiveret på moderne sider i klassiske teamwebsteder
Teknik
SCCM Kunne ikke hente DP-placeringer som den forventede version fra MP
Configmgr

Seneste indlæg

Installation og konfiguration af Fail2ban til SSH-beskyttelse på Ubuntu 24.04
Linux
Aktivering og konfiguration af FirewallD på AlmaLinux
Linux
Brugeroprettelse og SSH-nøgleopsætning i AlmaLinux
Linux
Sådan nulstiller du adgangskoden på AlmaLinux
Linux

© 2023 Enterine

Gå til mobil version
Velkommen tilbage!

Log ind på din konto

Brugernavn eller e-mail-adresse
Adgangskode

Mistet din adgangskode?