Afficher les instructions des scripts d’arrêt pendant leur exécution
Display instructions in shutdown scripts as they run
Explication
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.
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.
Registre
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System- Nom de la valeur
HideShutdownScripts
| État | Valeur écrite |
|---|---|
| Activé | REG_DWORD = 0 |
| Désactivé | REG_DWORD = 1 |
PowerShell
Commandes PowerShell qui écrivent dans le registre ce que la stratégie écrirait. Les valeurs entre chevrons (<…>) sont à remplacer.
Écrire directement dans le registre contourne la stratégie de groupe : si une GPO gère cette valeur, elle sera réécrite au prochain gpupdate ; sinon la valeur reste en place (effet « tatouage »). Préférez une GPO ou, en local, LGPO.exe. Exécutez PowerShell en administrateur pour HKLM. Certaines stratégies demandent un redémarrage ou gpupdate /force.
Activer
# Activer : 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 DWordDésactiver
# Désactiver : 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 DWordRevenir à « Non configuré »
# Revenir à « Non configuré » : Scripts/Run_Shutdown_Script_Visible
$k = 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System'
Remove-ItemProperty -Path $k -Name 'HideShutdownScripts' -ErrorAction SilentlyContinue