WinOpti is a powerful and modular PowerShell-based tool designed to perform comprehensive maintenance and optimization on the Windows operating system. It cleans temporary files, removes old logs, terminates non-essential processes, and leverages native Windows tools for a deep system cleanup, improving performance and freeing up disk space.
This project evolved from a simple batch script into a professional-grade application, emphasizing security, configurability, and robust error handling.
- Modular Architecture: Fully modular design with logic separated into distinct PowerShell modules (
.psm1
) for processes, file cleanup, and advanced disk cleanup. - External Configuration: Behavior is controlled via simple
.json
files, allowing users to customize what to clean without editing the source code. - Terminate Non-Essential Processes: Frees up RAM by closing a configurable list of applications (browsers, background services, etc.).
- Basic File Cleanup: Deletes user and system temporary files, old system logs, and browser caches.
- Advanced System Cleanup: Automates the native Windows Disk Cleanup tool (
cleanmgr.exe
) to safely remove:- Windows Update Cleanup
- Recycle Bin
- Delivery Optimization Files
- Thumbnails
- DirectX Shader Cache
- And many more system-managed caches.
- Safe and Interactive:
- Always asks for user confirmation before any destructive action.
- Dry Run Mode (
-DryRun
): Simulates all actions without making any changes to the system. - Unattended Mode (
-Unattended
): Runs all optimizations without prompts, ideal for scheduled tasks.
- Persistent Logging: Every action, warning, and error is recorded in a timestamped log file for full auditability. The log location is configurable.
The WinOpti directory structure is organized as follows to ensure modularity and easy maintenance:
WinOpti/
├── WinOpti.ps1
├── WinOpti.bat
├── Config/
│ ├── config.json
│ ├── diskcleanup.config.json
│ └── logging.config.json
├── Logs/
│ └── (Log files are generated here)
└── Modules/
├── WinOpti.Core.psm1
├── WinOpti.DiskCleanup.psm1
├── WinOpti.FileCleanup.psm1
└── WinOpti.Process.psm1
- Windows 10 or later.
- PowerShell 5.1 or later.
- Administrator Privileges: The script must be run as an Administrator to perform its tasks.
There are two primary methods for running WinOpti: via the command line for more control, or via a batch file for simplicity.
This method is recommended for users who are comfortable with PowerShell and want to use specific parameters.
A. Set Execution Policy (One-time setup) If you have never run PowerShell scripts before, open PowerShell as an Administrator and run the following command:
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
B. Run the Script Navigate to the project's root directory in PowerShell. You can then execute the script in several modes:
- Interactive Mode:
.\WinOpti.ps1
- Dry Run Mode (Simulation):
.\WinOpti.ps1 -DryRun
- Unattended Mode (For Automation):
.\WinOpti.ps1 -Unattended
For convenience, the project includes a WinOpti.bat
file. This allows users to run the optimizer with the necessary administrator privileges simply by double-clicking the file, bypassing the need to use the command line.
Any arguments (like -DryRun
or -Unattended
) can be passed by creating a shortcut to the .bat
file and adding the arguments to the shortcut's "Target" field.
Victor Oliveira (L0g0rhythm) - Connect via the links on the profile site: l0g0rhythm.com.br