Display instructions in shutdown scripts as they run
Afficher les instructions des scripts d’arrêt pendant leur exécution
Explanation
This policy setting displays the instructions in shutdown scripts as they run.
Shutdown scripts are batch files of instructions that run when the user restarts the system or shuts it down. By default, the system does not display the instructions in the shutdown script.
If you enable this policy setting, the system displays each instruction in the shutdown script as it runs. The instructions appear in a command window.
If you disable or do not configure this policy setting, the instructions are suppressed.
Ce paramètre de stratégie affiche les instructions des scripts d’arrêt lors de leur exécution.
Les scripts d’arrêt sont des fichiers de commandes comprenant des instructions qui sont exécutées chaque fois que l’utilisateur redémarre ou arrête le système. Par défaut, le système n’affiche pas les instructions du script d’arrêt.
Si vous activez ce paramètre de stratégie, le système affiche chaque instruction du script d’arrêt pendant son exécution. Les instructions apparaissent dans une fenêtre de commandes.
Si vous désactivez ou ne configurez pas ce paramètre de stratégie, les instructions sont supprimées.
Registry
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System- Value name
HideShutdownScripts
| State | Value written |
|---|---|
| Enabled | REG_DWORD = 0 |
| Disabled | REG_DWORD = 1 |
PowerShell
PowerShell commands that write to the registry what the policy would write. Values in angle brackets (<…>) must be replaced.
Writing directly to the registry bypasses Group Policy: if a GPO manages this value, it will be rewritten at the next gpupdate; otherwise the value stays in place (the "tattooing" effect). Prefer a GPO or, locally, LGPO.exe. Run PowerShell as administrator for HKLM. Some policies need a restart or gpupdate /force.
Enable
# Enable: Scripts/Run_Shutdown_Script_Visible
$k = 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'HideShutdownScripts' -Value 0 -Type DWordDisable
# Disable: Scripts/Run_Shutdown_Script_Visible
$k = 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'HideShutdownScripts' -Value 1 -Type DWordRevert to "Not configured"
# Revert to "Not configured": Scripts/Run_Shutdown_Script_Visible
$k = 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System'
Remove-ItemProperty -Path $k -Name 'HideShutdownScripts' -ErrorAction SilentlyContinue