Skip to main content

Clear Windows Registry favorite locations

Overview

About this script

This script improves your privacy on Windows.

These changes use Windows system commands to update your settings.

This script removes saved favorite locations in the Windows Registry Editor.

The Windows Registry Editor (regedit) allows users to save frequently accessed registry locations as favorites 1. This information is typically used by forensic analysts to study your behavior 2.

Clearing these favorites removes traces of your commonly accessed registry locations, enhancing your privacy. It may also improve system performance by reducing unnecessary data in the registry.

This script deletes all values under HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Applets\Regedit\Favorites 1 2 registry key.

Caution

Removing favorite locations in the registry editor will delete shortcuts to commonly accessed registry keys, which may need to be recreated manually.

This script uses Batch (batchfile) scripting language.

Use with Caution

This script is only recommended if you understand its implications. Some non-critical or features may no longer function correctly after running this script.

Implementation Details
  • Language: batch

  • Required Privileges: Administrator rights

  • Compatibility: Windows only

  • Reversibility: Some changes may be permanent

Explore Categories

This action belongs to Clear Windows Registry recent activity category. This category focuses on removing specific types of usage data from the Windows Registry to enhance privacy and improve system performance. The Windows Registry is a hierarchical database that stores settings, configurations, and options for the operating system, installed applications, and user... Read more on category page ▶

Apply now

Choose one of three ways to apply:

  1. Automatically via privacy.sexy: The easiest and safest option.
  2. Manually by downloading: Requires downloading a file.
  3. Manually by copying: Advanced flexibility.

Alternative 1. Apply with Privacy.sexy

privacy.sexy is free and open-source application that lets securely apply this action easily.

Open privacy.sexy

privacy.sexy instructions
  1. Open or download the desktop application
  2. Search for the script name: Clear Windows Registry favorite locations.
  3. Check the script by clicking on the checkbox.
  4. Click on Run button at the bottom of the page.

Alternative 2. Download

Reversible

This script is reversible, you can restore your changes to the initial/default state. The restore/revert methods provided here can help you fix issues.

If something goes wrong, use the Revert script provided above.

  1. Download the script file by clicking on the button below:

    Download script

  2. Run the script file by clicking on it.

Alternative 3. Copy

This is for advanced users. Consider automatically applying or downloading the script for simpler way.

  1. Open Command Prompt as administrator.
HELP: Step-by-step guide
  1. Click on Start menu

  2. Type cmd

  3. Right click on Command Prompt select Run as administrator

  4. Click on Yes to run Command Prompt


Animation showing how to open terminal as administrator on Windows 11

  1. Copy the following code:
Code to apply changes
:: Clear register values from "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Applets\Regedit\Favorites" 
PowerShell -ExecutionPolicy Unrestricted -Command "$rootRegistryKeyPath = 'HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Applets\Regedit\Favorites'; function Clear-RegistryKeyValues { try { $currentRegistryKeyPath = $args[0]; Write-Output "^""Clearing registry values from `"^""$currentRegistryKeyPath`"^""."^""; $formattedRegistryKeyPath = $currentRegistryKeyPath -replace '^([^\\]+)', '$1:'; if (-Not (Test-Path -LiteralPath $formattedRegistryKeyPath)) { Write-Output "^""Skipping: Registry key not found: `"^""$formattedRegistryKeyPath`"^""."^""; return; }; $directValueNames=(Get-Item -LiteralPath $formattedRegistryKeyPath -ErrorAction Stop | Select-Object -ExpandProperty Property); if (-Not $directValueNames) { Write-Output 'Skipping: Registry key has no direct values.'; } else { foreach ($valueName in $directValueNames) { Remove-ItemProperty -LiteralPath $formattedRegistryKeyPath -Name $valueName -ErrorAction Stop; Write-Output "^""Successfully deleted value: `"^""$valueName`"^"" from `"^""$formattedRegistryKeyPath`"^""."^""; }; Write-Output "^""Successfully cleared all direct values in `"^""$formattedRegistryKeyPath`"^""."^""; }; } catch { Write-Error "^""Failed to clear registry values in `"^""$formattedRegistryKeyPath`"^"". Error: $_"^""; Exit 1; }; }; Clear-RegistryKeyValues $rootRegistryKeyPath"
  1. Right click on command prompt to paste it.
  2. Press Enter to apply remaining code.

Support

This website relies on your support.

Support now

Your donation helps keep the project alive and improves its content ❤️.

Share this page: