Open in the explorer

Run legacy logon scripts hidden

Exécuter les scripts d’ouverture de session légués en mode caché

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_Legacy_Logon_Script_Hidden

Explanation

This policy setting hides the instructions in logon scripts written for Windows NT 4.0 and earlier.

Logon scripts are batch files of instructions that run when the user logs on. By default, Windows 2000 displays the instructions in logon scripts written for Windows NT 4.0 and earlier in a command window as they run, although it does not display logon scripts written for Windows 2000.

If you enable this setting, Windows 2000 does not display logon scripts written for Windows NT 4.0 and earlier.

If you disable or do not configure this policy setting, Windows 2000 displays login scripts written for Windows NT 4.0 and earlier.

Also, see the "Run Logon Scripts Visible" setting.

French text from Windows 11 26H2

Ce paramètre de stratégie masque les instructions des scripts d’ouverture de session écrits pour Windows NT 4.0 et les versions antérieures.

Les scripts d’ouverture de session sont des fichiers de commandes comprenant des instructions qui sont exécutées chaque fois que l’utilisateur ouvre une session. Par défaut, Windows 2000 affiche les instructions des scripts d’ouverture de session écrits pour Windows NT 4.0 et les versions antérieures dans une fenêtre de commandes au cours de leur exécution, mais il n’affiche pas les scripts d’ouverture de session écrits pour Windows 2000.

Si vous activez ce paramètre, Windows 2000 n’affiche pas les scripts d’ouverture de session écrits pour Windows NT 4.0 et les versions antérieures.

Si vous désactivez ou ne configurez pas ce paramètre de stratégie, Windows 2000 affiche les scripts d’ouverture de session écrits pour Windows NT 4.0 et les versions antérieures.

Consultez également le paramètre Exécuter les scripts d’ouverture de session en mode visible.

Registry

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System
Value name
HideLegacyLogonScripts
StateValue written
EnabledREG_DWORD = 1
DisabledREG_DWORD = 0

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_Legacy_Logon_Script_Hidden
$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 'HideLegacyLogonScripts' -Value 1 -Type DWord

Disable

# Disable: Scripts/Run_Legacy_Logon_Script_Hidden
$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 'HideLegacyLogonScripts' -Value 0 -Type DWord

Revert to "Not configured"

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

Availability