Open in the explorer

Prevent adding user-specified locations to the All Locations menu

Empêcher d’ajouter des emplacements spécifiés par l’utilisateur au menu Tous les fichiers

Type
Computer
GPO path
Computer Configuration › Policies › Administrative Templates › Windows Components › Search FR: Configuration ordinateur › Stratégies › Modèles d'administration › Composants Windows › Rechercher
Supported on
Microsoft Windows XP, or Windows Server 2003 with Windows Search version 4.0 or later FR: Microsoft Windows XP ou Windows Server 2003 avec Windows Search version 4.0 ou ultérieure
ADMX file
Search.admx
Internal name
Search/FavoriteLocations

Explanation

This policy setting allows you to enable or disable the Add/Remove location options on the All Locations menu as well as any defined locations that were made by a user. When this policy is not configured, the default behavior is to allow users to add and remove new locations to the locations menu. When the policy is enabled, the Add and Remove locations options and any previously defined user locations will not be visible. When the policy is disabled, both the Add and Remove locations options as well as any previously specified user locations will be visible.

French text from Windows 11 26H2

Ce paramètre de stratégie vous permet d’activer ou de désactiver les options Ajouter/Supprimer un fichier dans le menu Tous les fichiers ainsi que les fichiers définis créés par un utilisateur. Si cette stratégie n’est pas configurée, le comportement par défaut consiste à autoriser les utilisateurs à ajouter et supprimer de nouveaux fichiers dans le menu. Si la stratégie est activée, les options d’ajout et de suppression de fichiers ainsi que les fichiers définis par l’utilisateur ne sont pas visibles. Si cette stratégie est désactivée, les options d’ajout et de suppression de fichiers ainsi que les fichiers définis par l’utilisateur sont visibles.

Registry

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search
Value name
FavoriteLocations
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: Search/FavoriteLocations
$k = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'FavoriteLocations' -Value 1 -Type DWord

Disable

# Disable: Search/FavoriteLocations
$k = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'FavoriteLocations' -Value 0 -Type DWord

Revert to "Not configured"

# Revert to "Not configured": Search/FavoriteLocations
$k = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search'
Remove-ItemProperty -Path $k -Name 'FavoriteLocations' -ErrorAction SilentlyContinue

Availability