Skip to content

robertmeggle/winclean

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

removeBrowserData.ps1

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.


Features

  • 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

Usage

1. Allow PowerShell script execution (temporary)

Run PowerShell as Administrator and allow script execution for the current session:

Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass

2. Run the script

.
emoveBrowserData.ps1 -Perform -KillBrowsers -Aggressive

Parameters

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.

Example

To preview what would be deleted without actually removing anything:

.
emoveBrowserData.ps1

To run a full cleanup with backups and browser process termination:

.
emoveBrowserData.ps1 -Perform -KillBrowsers -Aggressive

Output

The 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.


Notes

  • 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).

License

This project is released under the MIT License.
You are free to use, modify, and distribute it with proper attribution.

About

Script to clean up your windows profile (remove stored browser passwords etc.)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors