A PowerShell script to securely delete saved passwords, cookies, history, cache, and site data from Microsoft Edge (Chromium) and Mozilla Firefox for the current Windows user.
The script can also close running browser processes, create a timestamped backup of all deleted files, and optionally perform a more aggressive cleanup of browser storage and metadata.
- Works for both Edge (Chromium-based) and Firefox profiles
- Removes:
- Saved passwords and autofill data
- Cookies and site data (LocalStorage, IndexedDB, ServiceWorker, etc.)
- Browser history and session restore files
- Caches (including GPU and code cache)
- Optional aggressive mode to remove additional metadata, thumbnails, and safe-browsing data
- Creates a backup folder on the desktop before deleting files
- Supports both preview mode (no deletions) and execution mode
- Compatible with PowerShell 5.1 and later
Run PowerShell as Administrator and allow script execution for the current session:
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass.
emoveBrowserData.ps1 -Perform -KillBrowsers -Aggressive| Parameter | Description |
|---|---|
-Perform |
Actually deletes files. If omitted, the script runs in preview mode (no deletion). |
-KillBrowsers |
Closes all Edge and Firefox processes before cleanup. Prevents file locks. |
-Aggressive |
Deletes additional caches, thumbnails, and metadata for deeper cleanup. |
To preview what would be deleted without actually removing anything:
.
emoveBrowserData.ps1To run a full cleanup with backups and browser process termination:
.
emoveBrowserData.ps1 -Perform -KillBrowsers -AggressiveThe script creates a backup folder on your desktop named like:
BrowserDataBackup_20251016_153210
A summary table is printed in the console listing all deleted and backed-up files.
- Only affects the current Windows user.
- If browser sync is enabled (e.g., Edge profile connected to a Microsoft account), some data may reappear after deletion.
→ Disable synchronization or sign out from your Edge/Firefox profile to ensure a full cleanup. - The backup folder allows you to restore deleted files if needed.
- Requires PowerShell 5.1+ (tested on Windows 10 and Windows 11).
This project is released under the MIT License.
You are free to use, modify, and distribute it with proper attribution.