| NAME | Tron PowerShell, an automated PC cleanup script |
|---|---|
| AUTHOR | Antigravity |
| BACKGROUND | A native PowerShell port of the legendary Tron script. |
Note
This is a complete rewrite of Tron in native PowerShell. It is designed to be faster, more modular, and easier to maintain than the original legacy batch script. Edits powered by Google Gemini Antigravity.
This PowerShell version includes several key improvements:
- β‘ Native Performance: Leverages the full power of the .NET framework for faster execution and better resource management.
- π§© Modular Design: Code is organized into distinct modules (
Core,Stages), making it easier to read, debug, and extend. - π‘οΈ Enhanced Safety: Better error handling and "Dry Run" capabilities allow you to test the script without making changes.
- π§ͺ Sandbox Mode: Includes a
Debug-Tron.ps1script to safely test logic in a local sandbox environment. - π Privacy Focused: Repository has been scrubbed of personal metadata and git history anonymized for privacy.
- Usage Summary
- Command-Line Use
- Requirements
- Project Structure
- Debugging & Development
- Full Description of Stages
- Advanced Documentation
-
FIRST THINGS FIRST: REBOOT THE COMPUTER BEFORE RUNNING TRON. This is to allow any pending updates to finish.
-
Download/Clone: Get the repository to your local machine.
-
Open PowerShell: Right-click the Start button and select PowerShell (Admin) or Terminal (Admin).
-
Run the Script:
.\Tron.ps1
-
Wait: The script will proceed through the stages automatically.
[!WARNING] DO NOT CANCEL THE SCRIPT once it has started Stage 2 (De-bloat) or Stage 3 (Disinfect), as this may leave the system in an inconsistent state.
-
Reboot: Reboot the system once the script completes.
Command-line use is fully supported. All switches are optional.
.\Tron.ps1 [-Autorun] [-DryRun] [-Verbose] [-SkipDebloat] [-SkipAntivirusScans] [-SkipCustomScripts] [-SkipDefrag]| Switch | Description |
|---|---|
-Autorun |
Run automatically without prompts (implies acceptance of all defaults). |
-DryRun |
Safe Mode. Run through the script logic without actually executing any jobs or making changes. |
-Verbose |
Show detailed output for debugging purposes. |
-SkipDebloat |
Skip Stage 2: De-bloat (OEM bloatware removal). |
-SkipAntivirusScans |
Skip Stage 3: Disinfect (Malwarebytes, AdwCleaner, etc.). |
-SkipCustomScripts |
Skip Stage 8: Custom Scripts. |
-SkipDefrag |
Skip Stage 6: Optimize (Defrag). |
- OS: Windows 7 (SP1), 8, 8.1, 10, 11.
- PowerShell: Version 5.1 or higher (Pre-installed on Windows 10/11).
- Privileges: Administrator rights are highly recommended.
- Limited Mode: If run without Admin rights, Tron will skip privileged tasks (DISM, SFC, App removal) but still perform user-level cleanup.
The project has been reorganized for modularity and ease of contribution:
Tron.ps1: Main Entry Point. Orchestrates the execution flow.Modules/: Contains the logic for the script.Tron.Core.psm1: Core functions (Logging, Configuration, State management).Tron.Stages.psm1: Specific logic for each execution stage (Prep, TempClean, De-bloat, etc.).
Resources/: External tools and assets (e.g.,rkill,AdwCleaner).Config/: Configuration files.defaults.json: Default settings and preferences.
To test the script logic without affecting your actual system, use the Debug-Tron.ps1 script.
How it works:
- Creates a local
Sandboxfolder in the project root. - Populates it with mock files and directories.
- Redirects
Tron.ps1to operate only within this Sandbox.
.\Debug-Tron.ps1This is perfect for testing new features or verifying that file cleanup logic works as expected.
Here is a breakdown of what each stage does in the PowerShell version:
- System Restore: Attempts to create a system restore point.
- Rkill: Runs Rkill to terminate known malware processes.
- Process Killer: Terminates interfering userland processes.
- SMART Check: Checks hard drive health.
- Temp Files: Cleans Windows temp folders, browser caches, and other temporary locations.
- Event Logs: Backs up and clears Windows Event Logs.
- Windows Update Cache: Clears old Windows Update files to free space.
- OEM Bloatware: Removes common pre-installed bloatware based on a curated list.
- Metro Apps: Removes unused Windows Store (Metro) apps.
- Malwarebytes: Installs and runs Malwarebytes Anti-Malware.
- AdwCleaner: Runs Malwarebytes AdwCleaner to remove adware and PUPs.
- KVRT: Runs Kaspersky Virus Removal Tool.
- DISM: Checks and repairs the Windows Image Store.
- SFC: Runs System File Checker to repair corrupted system files.
- Telemetry: Disables Windows telemetry and tracking features.
- Network: Resets network stack (Winsock, DNS cache).
- Windows Updates: Triggers Windows Update to find and install missing patches.
- 7-Zip: Installs or updates 7-Zip.
- Defrag: Defragments mechanical drives (skips SSDs).
- Page File: Resets page file settings to Windows defaults.
- Report: Generates a summary report of actions taken.
- Cleanup: Removes temporary tools and files used by Tron.
- User Scripts: Executes any custom
.bator.ps1scripts placed in theResources\Stage_8_Custom_Scriptsfolder.
For more detailed information, please refer to the following documents:
- ARCHITECTURE.md: Deep dive into the modular design and code structure.
- BUILDING.md: Instructions for building release packages from source.
- ROADMAP.md: Future development plans and goals.
- SECURITY.md: Security policy and vulnerability reporting.
- CONTRIBUTING.md: Guidelines for contributing to the project.