Uruchamiaj skrypty środowiska Windows PowerShell jako pierwsze przy uruchamianiu i zamykaniu komputera: wartość rejestru RunComputerPSScriptsFirstKomputerHKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System

Identyfikator zasady
Run_Computer_PS_Scripts_First
Zakres
Konfiguracja komputera
Obsługiwane w systemach
System Windows Server 2008 R2 lub nowszy albo system Windows 7
Źródło
Administrative Templates (.admx) for Windows 11 2026 Update (26H2) (wersja 1.0)
Kategoria
System › Skrypty

Rejestr

RunComputerPSScriptsFirst

REG_DWORDKomputer
Wartość włączona
1
Wartość wyłączona
0
Zastosuj przez .reg · CMD · PowerShell
.reg
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System]

; Opcje (użyj tylko jednej)
; Włączone
"RunComputerPSScriptsFirst"=dword:00000001
; Wyłączone
"RunComputerPSScriptsFirst"=dword:00000000
CMD
:: Opcje (użyj tylko jednej)

:: Włączone
reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System" /v "RunComputerPSScriptsFirst" /t REG_DWORD /d 1 /f
:: Wyłączone
reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System" /v "RunComputerPSScriptsFirst" /t REG_DWORD /d 0 /f
PowerShell
# Wspólne: utwórz klucz
New-Item -Path 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System' -Force | Out-Null

# Opcje (użyj tylko jednej)
# Włączone
New-ItemProperty -Path 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System' -Name 'RunComputerPSScriptsFirst' -PropertyType DWord -Value 1 -Force | Out-Null
# Wyłączone
New-ItemProperty -Path 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System' -Name 'RunComputerPSScriptsFirst' -PropertyType DWord -Value 0 -Force | Out-Null