Skip to content

kdsmith10000/WinTrim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

7 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿงน WinTrim 2.0

Comprehensive Windows Cleanup Tool

WinTrim 2.0 is a powerful, modular cleanup tool that goes beyond simple duplicate removal. It intelligently cleans your Windows system across multiple areas while keeping your system safe and functional. Like Marie Kondo for your entire Windows installationโ€”keeping only what sparks joy (and functionality).

PowerShell Windows License Version GitHub Stars GitHub Forks GitHub Issues GitHub Last Commit GitHub Downloads

โœจ New in Version 2.0

๐ŸŽฏ Six Powerful Cleanup Modules

  1. Duplicate Programs (Original WinTrim)

    • Removes old software updates and duplicate redistributables
    • Intelligent pattern matching and online version checking
    • Keeps different Visual C++ years and editions separate
  2. Temp Files Cleanup

    • Cleans system and user temporary directories
    • Safe removal of old temporary files
    • Typical savings: 1-10 GB
  3. Windows Update Cache

    • Clears Windows Update download cache
    • Safely stops and restarts update services
    • Typical savings: 5-20 GB
  4. Browser Cache Cleanup

    • Supports Brave, Chrome, Edge, and Firefox
    • Clears code cache and regular cache
    • Typical savings: 500 MB - 5 GB
  5. System Cache Cleanup

    • Thumbnail cache, shader cache, icon cache
    • Windows error reports and old logs
    • Prefetch files older than 7 days
    • Typical savings: 1-3 GB
  6. Advanced DISM Cleanup

    • Component store analysis and cleanup
    • Superseded component removal
    • Most thorough but slowest (10-30 minutes)
    • Typical savings: 2-10 GB

๐ŸŽฎ Interactive Module Selection

  • Run all modules or pick specific ones
  • Easy-to-use menu interface
  • Each module runs independently with its own confirmation

๐Ÿ“Š Enhanced Reporting

  • Comprehensive final statistics
  • Per-module breakdown
  • Time tracking
  • Total space freed across all modules

๐Ÿš€ Quick Start

Prerequisites

  • Windows 10 or Windows 11
  • PowerShell 5.1 or later
  • Administrator privileges

Installation

  1. Download WinTrim

    # Clone the repository
    git clone https://github.com/kdsmith10000/WinTrim.git
    cd WinTrim
  2. Run as Administrator

    • Right-click PowerShell
    • Select "Run as Administrator"
    • Navigate to the WinTrim directory
    • Run the script:
    .\WinTrim.ps1

๐Ÿ“– Usage

Basic Usage

Simply run the script and follow the interactive prompts:

.\WinTrim.ps1

The script will:

  1. โœ… Prompt to create a system restore point (recommended!)
  2. ๐Ÿ“‹ Show available cleanup modules
  3. ๐ŸŽฏ Let you select which modules to run (or run all)
  4. ๐Ÿ” Scan and analyze each selected module
  5. ๐Ÿ’พ Display estimated disk space savings per module
  6. โš ๏ธ Ask for confirmation before each cleanup operation
  7. ๐Ÿ—‘๏ธ Perform cleanup operations
  8. ๐Ÿ“Š Show comprehensive final statistics

Interactive Module Selection

Available modules:
  1. Duplicate Programs - Remove old software updates (original WinTrim)
  2. Temp Files - Clean system and user temp directories
  3. Windows Update Cache - Clear update download cache
  4. Browser Cache - Clear browser caches (Brave, Chrome, Edge, Firefox)
  5. System Cache - Clean thumbnails, logs, error reports, shader cache
  6. Advanced DISM - Component store cleanup (slow but thorough)
  A. All modules
  Q. Quit

Enter modules to run (e.g., '1,2,3' or 'A' for all):

What Gets Cleaned by Module

Module 1: Duplicate Programs

  • โœ… Visual C++ Redistributables (old versions of same year/edition)
  • โœ… Microsoft .NET Runtime (outdated versions)
  • โœ… Microsoft Edge Updates (old update helpers)
  • โœ… MongoDB, Java, Adobe updates (old versions)
  • โŒ NEVER removes different Visual C++ years (coexist by design)
  • โŒ NEVER removes Python components (part of one installation)
  • โŒ NEVER removes single installations

Module 2-6: System Cleanup

  • Temporary files (system and user)
  • Windows Update download cache
  • Browser caches (all major browsers)
  • Thumbnail, shader, and icon caches
  • Windows error reports and old logs
  • Superseded Windows components (DISM)

๐Ÿ’ก Example Output

========================================
  WinTrim v2.0
  Comprehensive Windows Cleanup
========================================

Available modules:
  1. Duplicate Programs - Remove old software updates (original WinTrim)
  2. Temp Files - Clean system and user temp directories
  3. Windows Update Cache - Clear update download cache
  4. Browser Cache - Clear browser caches (Brave, Chrome, Edge, Firefox)
  5. System Cache - Clean thumbnails, logs, error reports, shader cache
  6. Advanced DISM - Component store cleanup (slow but thorough)
  A. All modules
  Q. Quit

Enter modules to run (e.g., '1,2,3' or 'A' for all): A

Modules to run:
  โœ“ Duplicate Programs
  โœ“ Temp Files
  โœ“ Windows Update Cache
  โœ“ Browser Cache
  โœ“ System Cache
  โœ“ Advanced DISM

========================================
  MODULE: Temporary Files Cleanup
========================================

Scanning temp directories...
Total potential space to free: 3.45 GB

Proceed with temp files cleanup? (Y/N) Y

Temp Cleanup Results:
  Files removed: 15,234
  Space freed: 3.45 GB

... [other modules run] ...

========================================
  WinTrim Cleanup Complete!
========================================

FINAL STATISTICS:
-------------------
Total space freed: 24.67 GB
Programs removed: 8
Temp files removed: 15,234
Time elapsed: 12m 34s

CLEANUP BY MODULE:
-------------------
Temp Files: 15,234 files removed
Windows Update: 8.23 GB
Browser Cache: 4.12 GB
System Cache: 2.34 GB
Duplicate Programs: 8 removed
DISM Cleanup: 6.53 GB

๐Ÿ”ง Advanced Configuration

Execution Policy

If you encounter execution policy errors:

Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process
.\WinTrim.ps1

Custom Patterns

You can modify the $patterns array in the script to add your own software patterns:

$patterns = @(
    "Microsoft Edge",
    "Your Custom Pattern"
)

๐Ÿ“Š Statistics & Reporting

After cleanup, WinTrim provides:

REMOVAL STATISTICS:
-------------------
Programs targeted for removal: 8
Successfully removed: 8
Failed to remove: 0

DISK SPACE SAVINGS:
-------------------
Total disk space freed: 102.95 MB

ESTIMATED MEMORY SAVINGS:
-------------------------
Potential RAM savings: ~600 MB
(Old update services no longer running)

ADDITIONAL BENEFITS:
--------------------
- Cleaner Add/Remove Programs list
- Reduced registry clutter
- Faster system scans and updates

๐Ÿ›ก๏ธ Safety & Security

Security Features

  • โœ… Requires Administrator Privileges: Prevents unauthorized execution
  • โœ… No Internet Dependencies: Works offline (uses cached version data as fallback)
  • โœ… No Data Collection: Completely private, nothing sent anywhere
  • โœ… Open Source: Fully auditable code

Security Audit

WinTrim has been designed with security in mind:

  • No arbitrary code execution: Only uses uninstall strings from registry
  • Input validation: All registry data is validated before use
  • Safe defaults: Conservative approach, keeps items when in doubt
  • Restore point integration: Easy rollback if needed

โš ๏ธ Important Notes

Before Running

  1. Create a backup of important data
  2. Close all programs before running
  3. Read the preview carefully before confirming removal
  4. Accept the restore point prompt (strongly recommended)

Known Limitations

  • Some programs may fail to uninstall silently (exit code 1603)
  • Requires manual intervention for programs with custom uninstallers
  • Online version checking requires internet connection (falls back to cached data)

๐Ÿ› Troubleshooting

"Script not recognized" error

# Use full path
C:\path\to\WinTrim.ps1

"Execution policy" error

Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process

"Not running as administrator"

Right-click PowerShell โ†’ "Run as Administrator"

Items failed to remove

Check the exit code in the output. Common codes:

  • 1603: Installation failed (dependency issue)
  • 1605: Product not found (already removed)

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Areas for Contribution

  • ๐ŸŒ Additional online version sources
  • ๐ŸŽฏ More software patterns
  • ๐ŸŒ Internationalization
  • ๐Ÿ“ Documentation improvements
  • ๐Ÿ› Bug fixes

๐Ÿ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Inspired by the need for safer Windows cleanup tools
  • Built with feedback from the Windows power user community
  • Thanks to all contributors and testers

๐Ÿ“ž Support

โšก Roadmap

โœ… Completed (v2.0)

  • Modular cleanup system
  • Temp files cleanup
  • Windows Update cache cleanup
  • Browser cache cleanup
  • System cache cleanup
  • DISM component cleanup
  • Comprehensive statistics and reporting

๐Ÿ”ฎ Future Enhancements

  • GUI version
  • Scheduled cleanup tasks
  • Export/import cleanup profiles
  • Detailed HTML/JSON reports
  • Per-module rollback
  • Portable version (no installation required)
  • Recycle Bin cleanup module
  • Windows.old removal module
  • Driver store cleanup
  • More granular control per cleanup type

Screenshots

1

2

3

4


Made with โค๏ธ for the Windows community

WinTrim - Keep your Windows installation lean and clean!

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •