Open in the explorer

Display instructions in logoff scripts as they run

Afficher des instructions des scripts de fermeture de session pendant leur exécution

Type
User
GPO path
User Configuration › Policies › Administrative Templates › System › Scripts FR: Configuration utilisateur › Stratégies › Modèles d'administration › Système › Scripts
Supported on
At least Windows 2000 FR: Au minimum Windows 2000
ADMX file
Scripts.admx
Internal name
Scripts/Run_Logoff_Script_Visible

Explanation

This policy setting displays the instructions in logoff scripts as they run.

Logoff scripts are batch files of instructions that run when the user logs off. By default, the system does not display the instructions in the logoff script.

If you enable this policy setting, the system displays each instruction in the logoff script as it runs. The 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.

French text from Windows 11 26H2

Ce paramètre de stratégie affiche les instructions des scripts de fermeture de session pendant leur exécution.

Les scripts de fermeture de session sont des fichiers de commandes comprenant des instructions qui sont exécutées chaque fois que l’utilisateur ferme une session. Par défaut, le système n’affiche pas les instructions du script de fermeture de session.

Si vous activez ce paramètre de stratégie, le système affiche chaque instruction du script de fermeture de session 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.

Registry

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System
Value name
HideLogoffScripts
StateValue written
EnabledREG_DWORD = 0
DisabledREG_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_Logoff_Script_Visible
$k = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\System'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'HideLogoffScripts' -Value 0 -Type DWord

Disable

# Disable: Scripts/Run_Logoff_Script_Visible
$k = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\System'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'HideLogoffScripts' -Value 1 -Type DWord

Revert to "Not configured"

# Revert to "Not configured": Scripts/Run_Logoff_Script_Visible
$k = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\System'
Remove-ItemProperty -Path $k -Name 'HideLogoffScripts' -ErrorAction SilentlyContinue

Availability