Open in the explorer

Remove "Work offline" command

Supprimer la commande « Travailler hors connexion »

Type
User
GPO path
User Configuration › Policies › Administrative Templates › Network › Offline Files FR: Configuration utilisateur › Stratégies › Modèles d'administration › Réseau › Fichiers hors connexion
Supported on
At least Windows Server 2012, Windows 8 or Windows RT FR: Au minimum Windows Server 2012, Windows 8 ou Windows RT
ADMX file
OfflineFiles.admx
Internal name
OfflineFiles/Pol_WorkOfflineDisabled_1

Explanation

This policy setting removes the "Work offline" command from Explorer, preventing users from manually changing whether Offline Files is in online mode or offline mode.

If you enable this policy setting, the "Work offline" command is not displayed in File Explorer.

If you disable or do not configure this policy setting, the "Work offline" command is displayed in File Explorer.

French text from Windows 11 26H2

Ce paramètre de stratégie supprime la commande « Travailler hors connexion » de l’Explorateur pour empêcher les utilisateurs de modifier manuellement le mode hors connexion ou le mode connexion des fichiers hors connexion.

Si vous activez ce paramètre de stratégie, la commande « Travailler hors connexion » n’est pas affichée dans l’Explorateur de fichiers.

Si vous désactivez ou ne configurez pas ce paramètre de stratégie, la commande « Travailler hors connexion » est affichée dans l’Explorateur de fichiers.

Registry

HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\NetCache
Value name
WorkOfflineDisabled
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: OfflineFiles/Pol_WorkOfflineDisabled_1
$k = 'HKCU:\Software\Policies\Microsoft\Windows\NetCache'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'WorkOfflineDisabled' -Value 1 -Type DWord

Disable

# Disable: OfflineFiles/Pol_WorkOfflineDisabled_1
$k = 'HKCU:\Software\Policies\Microsoft\Windows\NetCache'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'WorkOfflineDisabled' -Value 0 -Type DWord

Revert to "Not configured"

# Revert to "Not configured": OfflineFiles/Pol_WorkOfflineDisabled_1
$k = 'HKCU:\Software\Policies\Microsoft\Windows\NetCache'
Remove-ItemProperty -Path $k -Name 'WorkOfflineDisabled' -ErrorAction SilentlyContinue

Availability