Display instructions in startup scripts as they run
Afficher les instructions des scripts de démarrage pendant leur exécution
Explanation
This policy setting displays the instructions in startup scripts as they run.
Startup scripts are batch files of instructions that run before the user is invited to log on. By default, the system does not display the instructions in the startup script.
If you enable this policy setting, the system displays each instruction in the startup script as it runs. Instructions appear in a command window. This policy setting is designed for advanced users.
If you disable or do not configure this policy setting, the instructions are suppressed.
Note: Starting with Windows Vista operating system, scripts that are configured to run asynchronously are no longer visible on startup, whether this policy setting is enabled or not.
Ce paramètre de stratégie affiche les instructions des scripts de démarrage lors de leur exécution.
Les scripts de démarrage sont des fichiers de commandes comprenant des instructions qui sont exécutées avant que l’utilisateur ne soit invité à ouvrir une session. Par défaut, le système n’affiche pas les instructions du script de démarrage.
Si vous activez ce paramètre de stratégie, le système affiche chaque instruction du script de démarrage pendant son exécution. Les instructions apparaissent dans une fenêtre de commandes. Ce paramètre de stratégie est destiné aux utilisateurs expérimentés.
Si vous désactivez ce paramètre de stratégie ou ne le configurez pas, les instructions sont supprimées.
Remarque : avec l’arrivée du système d’exploitation Windows Vista, les scripts configurés pour s’exécuter de manière asynchrone ne sont plus visibles au démarrage, que ce paramètre de stratégie soit activé ou non.
Registry
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System- Value name
HideStartupScripts
| 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_Startup_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 'HideStartupScripts' -Value 0 -Type DWordDisable
# Disable: Scripts/Run_Startup_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 'HideStartupScripts' -Value 1 -Type DWordRevert to "Not configured"
# Revert to "Not configured": Scripts/Run_Startup_Script_Visible
$k = 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System'
Remove-ItemProperty -Path $k -Name 'HideStartupScripts' -ErrorAction SilentlyContinue