Clear Windows Run command history
Overview
This script improves your privacy on Windows.
These changes use Windows system commands to update your settings.
This script clears the Most Recently Used (MRU) list in Windows Run.
Windows Run is a utility that allows users to quickly open programs, files, folders, and web pages 1 2 3. It's also known as the Windows Run dialog box 2 4, Windows Command Window 3, Windows Run Box 5, Windows Run utility 1 6, and Windows Run window 1.
You can access it by:
- Pressing Windows logo key + R 1 3
- Searching for Run in the Start Menu 1 2
- Running specific commands:
Keeping this data poses privacy and security risks:
- It reveals user activity on the system, including accessed files and applications 1 5 6
- Forensic analysts use this data to study user behavior 1 5 6
- Attackers use this data to understand user activities or execute malicious code 5
Clearing this data improves your privacy and security by:
- Removing traces of your recent activities
- Preventing third parties from gaining insights into your system usage
- Reducing the risk of malicious code execution via manipulated data entries
It can also improve system performance by reducing the amount of data Windows needs to process when accessing the Run dialog history.
This script deletes all registry values under HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU
1 5 6.
To ensure the changes take effect, close and reopen the Run window if it's currently open 1.
This script will erase your Run command history, potentially slowing down access to frequently used programs and files.
This script uses Batch (batchfile) scripting language.
This script is recommended for all users. It helps to improve privacy without affecting stability.
Implementation Details
-
Language: batch
-
Required Privileges: Administrator rights
-
Compatibility: Windows only
-
Reversibility: Some changes may be permanent
Explore Categories
- Clear recent activity
- Privacy cleanup
This action belongs to Clear recent activity category. This category includes scripts that erase traces of recent user activities on Windows. These scripts enhance privacy by removing records of accessed files, used applications, and changed system settings. Clearing recent activity is crucial for protecting your privacy. Your computer keeps... Read more on category page ▶
This action belongs to Privacy cleanup category. This category configures Windows using 86 scripts. These scripts are organized in 18 categories. The category includes 9 subscripts and 5 subcategories that include more scripts and categories. Read more on category page ▶
Apply now
Choose one of three ways to apply:
- Automatically via privacy.sexy: The easiest and safest option.
- Manually by downloading: Requires downloading a file.
- 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.
privacy.sexy instructions
- Open or download the desktop application
- Search for the script name:
Clear Windows Run command history
. - Check the script by clicking on the checkbox.
- Click on Run button at the bottom of the page.
Alternative 2. Download
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.
-
Download the script file by clicking on the button below:
-
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.
- Open Command Prompt as administrator.
HELP: Step-by-step guide
-
Click on Start menu
- Windows 11
- Windows 10
-
Type cmd
- Windows 11
- Windows 10
-
Right click on Command Prompt select Run as administrator
- Windows 11
- Windows 10
-
Click on Yes to run Command Prompt
- Windows 11
- Windows 10
- Windows 11
- Windows 10
- Copy the following code:
:: Clear register values from "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU"
PowerShell -ExecutionPolicy Unrestricted -Command "$rootRegistryKeyPath = 'HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU'; 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"
- Right click on command prompt to paste it.
- Press Enter to apply remaining code.
Support
This website relies on your support.
Your donation helps keep the project alive and improves its content ❤️.
Share this page: