Custom TRON 11 Script

I created a batch script using ChatGPT to download three maintenance tools and clean up a Windows 11 computer. The script can run in unattended mode, which is useful since some steps may take a while to complete.

I developed a new script because the original TRON script was designed for Windows 10 and didn’t run properly on Windows 11.

To use the script, copy it to your Desktop and run it as an Administrator.

The Script as of Oct 15

Summary of Key Features

✅ Creates and logs everything to your desktop
✅ Downloads all 3 tools to %USERPROFILE%\Downloads
✅ Renames them before copying to the correct tool folders
✅ Deletes temporary .exe files from the Downloads folder afterward
✅ Creates a restore point before running any cleaning/scanning
✅ Verifies each tool’s existence
✅ Runs cleanup, repair, and optimization
✅ Optionally keeps or removes setup folders

@echo off
title TRON11 Master Script - Full Logging + Verification (Windows 11)
color 0b
setlocal enabledelayedexpansion

:: ==================================================
:: VARIABLES
:: ==================================================
set "BASE=C:\TRON11"
set "TOOLS=%BASE%\tools"
set "BB_PATH=%TOOLS%\bleachbit\bleachbit_console.exe"
set "ADW_PATH=%TOOLS%\adwcleaner\adwcleaner.exe"
set "SOPHOS_PATH=%TOOLS%\sophos\sophosscan.exe"
set "DLFOLDER=%USERPROFILE%\Downloads"
set "LOGFILE=%USERPROFILE%\Desktop\TRON11_Log.txt"

:: ==================================================
:: MENU OPTIONS
:: ==================================================
echo ==================================================
echo TRON11 Master Script (Windows 11)
echo ==================================================
echo Select an option by number:
echo 1. Run TRON11 automatically (no prompts)
echo 2. Keep setup folders/files after running
echo 3. Enable logging to Desktop (%LOGFILE%)
echo.
set /p "CHOICE=Enter numbers separated by commas (e.g., 1,2,3): "

:: Parse options
set "AUTO_RUN=false"
set "KEEP_FILES=false"
set "ENABLE_LOG=false"

for %%A in (%CHOICE%) do (
    if %%A==1 set "AUTO_RUN=true"
    if %%A==2 set "KEEP_FILES=true"
    if %%A==3 set "ENABLE_LOG=true"
)

:: ==================================================
:: ENABLE LOGGING
:: ==================================================
if "%ENABLE_LOG%"=="true" (
    echo [+] Logging enabled → %LOGFILE%
    echo TRON11 Run started at %DATE% %TIME% > "%LOGFILE%"
) 

:: Helper function to echo & log
set "LOGCMD=echo"
if "%ENABLE_LOG%"=="true" set "LOGCMD=echo >> "%LOGFILE%""

:: ==================================================
:: PHASE 1 - SETUP FOLDERS
:: ==================================================
%LOGCMD% [+] Creating TRON11 folders...
mkdir "%TOOLS%\bleachbit" >nul 2>&1
mkdir "%TOOLS%\adwcleaner" >nul 2>&1
mkdir "%TOOLS%\sophos" >nul 2>&1
%LOGCMD% [+] Folders created at %BASE%
echo.

:: ==================================================
:: PHASE 1a - DOWNLOAD FILES TO USER DOWNLOADS FOLDER
:: ==================================================
%LOGCMD% [+] Starting downloads into %DLFOLDER%...
echo.

:: BleachBit
%LOGCMD% [+] Downloading BleachBit...
curl -L -o "%DLFOLDER%\bb.exe" https://download.bleachbit.org/bb.exe >> "%LOGFILE%" 2>&1
if exist "%DLFOLDER%\bb.exe" (
    ren "%DLFOLDER%\bb.exe" "bleachbit_console.exe" >nul 2>&1
    copy /Y "%DLFOLDER%\bleachbit_console.exe" "%TOOLS%\bleachbit\" >nul
    %LOGCMD% [+] BleachBit downloaded, renamed, and copied successfully.
) else (
    %LOGCMD% [!] Failed to download BleachBit.
)

:: AdwCleaner
%LOGCMD% [+] Downloading AdwCleaner...
curl -L -o "%DLFOLDER%\adwcleaner.exe" https://downloads.malwarebytes.com/file/adwcleaner >> "%LOGFILE%" 2>&1
if exist "%DLFOLDER%\adwcleaner.exe" (
    ren "%DLFOLDER%\adwcleaner.exe" "adwcleaner.exe" >nul 2>&1
    copy /Y "%DLFOLDER%\adwcleaner.exe" "%TOOLS%\adwcleaner\" >nul
    %LOGCMD% [+] AdwCleaner downloaded, renamed, and copied successfully.
) else (
    %LOGCMD% [!] Failed to download AdwCleaner.
)

:: Sophos
%LOGCMD% [+] Downloading Sophos Virus Removal Tool...
curl -L -o "%DLFOLDER%\sophosscan.exe" https://downloads.sophos.com/tools/SophosVirusRemovalToolSetup.exe >> "%LOGFILE%" 2>&1
if exist "%DLFOLDER%\sophosscan.exe" (
    ren "%DLFOLDER%\sophosscan.exe" "sophosscan.exe" >nul 2>&1
    copy /Y "%DLFOLDER%\sophosscan.exe" "%TOOLS%\sophos\" >nul
    %LOGCMD% [+] Sophos downloaded, renamed, and copied successfully.
) else (
    %LOGCMD% [!] Failed to download Sophos.
)

:: Delete downloaded files from Downloads folder
%LOGCMD% [+] Cleaning up leftover downloads from %DLFOLDER%...
del /f /q "%DLFOLDER%\bleachbit_console.exe" >nul 2>&1
del /f /q "%DLFOLDER%\adwcleaner.exe" >nul 2>&1
del /f /q "%DLFOLDER%\sophosscan.exe" >nul 2>&1
%LOGCMD% [+] Downloads folder cleaned.
echo.

:: ==================================================
:: PHASE 1b - CREATE SYSTEM RESTORE POINT
:: ==================================================
%LOGCMD% [+] Creating system restore point...
powershell -Command "Checkpoint-Computer -Description 'TRON11 Pre-Cleanup' -RestorePointType 'MODIFY_SETTINGS'" 2>nul
if %ERRORLEVEL% EQU 0 (
    %LOGCMD% [+] System Restore Point created successfully.
) else (
    %LOGCMD% [!] Failed to create System Restore Point. Ensure System Protection is enabled.
)
echo.

:: ==================================================
:: PHASE 2 - TOOL VERIFICATION
:: ==================================================
echo [+] Verifying required tools exist...
set "MISSING_TOOLS="
if exist "%BB_PATH%" (
    %LOGCMD% [+] Found: BleachBit
) else (
    %LOGCMD% [!] Missing: BleachBit
    set "MISSING_TOOLS=!MISSING_TOOLS! BleachBit; "
)

if exist "%ADW_PATH%" (
    %LOGCMD% [+] Found: AdwCleaner
) else (
    %LOGCMD% [!] Missing: AdwCleaner
    set "MISSING_TOOLS=!MISSING_TOOLS! AdwCleaner; "
)

if exist "%SOPHOS_PATH%" (
    %LOGCMD% [+] Found: Sophos
) else (
    %LOGCMD% [!] Missing: Sophos
    set "MISSING_TOOLS=!MISSING_TOOLS! Sophos; "
)

if defined MISSING_TOOLS (
    %LOGCMD% [!] Warning: Some tools are missing. They will be skipped.
)

echo.

:: ==================================================
:: PHASE 2b - CLEANUP & SCANS
:: ==================================================
%LOGCMD% [+] Cleaning temporary files...
del /s /f /q %TEMP%\* >nul 2>&1
del /s /f /q C:\Windows\Temp\* >nul 2>&1

%LOGCMD% [+] Running system checks...
sfc /scannow >> "%LOGFILE%" 2>&1
chkdsk C: /scan >> "%LOGFILE%" 2>&1
DISM /Online /Cleanup-Image /RestoreHealth >> "%LOGFILE%" 2>&1

%LOGCMD% [+] Running malware/adware scans...
if exist "%BB_PATH%" start /wait "" "%BB_PATH%" --clean
if exist "%ADW_PATH%" start /wait "" "%ADW_PATH%" /clean /noreboot
if exist "%SOPHOS_PATH%" start /wait "" "%SOPHOS_PATH%" /silent
echo.

%LOGCMD% [+] Final cleanup & optimization...
net stop wuauserv >nul 2>&1
del /s /f /q C:\Windows\SoftwareDistribution\* >nul 2>&1
net start wuauserv >nul 2>&1
defrag C: /O
ipconfig /flushdns
vssadmin delete shadows /all /quiet
echo.

:: ==================================================
:: PHASE 3 - CLEANUP (optional)
:: ==================================================
if "%KEEP_FILES%"=="false" (
    %LOGCMD% [+] Removing TRON11 setup folders & files...
    net stop wuauserv >nul 2>&1
    net stop bits >nul 2>&1
    net stop cryptsvc >nul 2>&1
    rmdir /s /q "%BASE%"
    net start wuauserv >nul 2>&1
    net start bits >nul 2>&1
    net start cryptsvc >nul 2>&1
    %LOGCMD% [+] Cleanup complete.
) else (
    %LOGCMD% [+] Keeping setup folders and files per selected option.
)
echo.

:: ==================================================
:: FINISHED
:: ==================================================
%LOGCMD% TRON11 Master Script Complete!
if "%ENABLE_LOG%"=="true" echo Log saved to %LOGFILE%
pause
exit /b

Explanation of the script

TRON11 Master Script — Detailed Step-by-Step Breakdown


PHASE 0 – Startup & Options

  1. Sets variables for all directories and file paths:
    • Base working folder → C:\TRON11
    • Tool folders → C:\TRON11\tools\bleachbit, adwcleaner, sophos
    • Download folder → %USERPROFILE%\Downloads
    • Log file → %USERPROFILE%\Desktop\TRON11_Log.txt
  2. Displays a startup menu with three numbered options:
    • You can type one or more (e.g. 1,3) to activate multiple options.
1. Run TRON11 automatically (no prompts)
2. Keep setup folders/files after running
3. Enable logging to Desktop
  1. Sets internal flags based on your choices:
    • AUTO_RUN=true → Runs without pauses.
    • KEEP_FILES=true → Leaves all setup folders and tools intact.
    • ENABLE_LOG=true → Writes all actions to a desktop log file.
  2. If logging is enabled, it creates or overwrites TRON11_Log.txt and writes a timestamped header.
    From here on, every major step logs both to screen and file.

PHASE 1 – Folder Setup

  1. Creates working folders under C:\TRON11:
    • (Skips creating if they already exist.)
C:\TRON11\tools\bleachbit
C:\TRON11\tools\adwcleaner
C:\TRON11\tools\sophos
  1. Logs confirmation that all folders are ready.

PHASE 1a – Download & Prepare Tools

  1. Downloads each cleaning tool directly into your Windows Downloads folder using curl:
ToolDownloaded FromTemporary Filename
BleachBithttps://download.bleachbit.org/bb.exebb.exe
AdwCleanerhttps://downloads.malwarebytes.com/file/adwcleaneradwcleaner.exe
Sophos Virus Removal Toolhttps://downloads.sophos.com/tools/SophosVirusRemovalToolSetup.exesophosscan.exe
  1. Renames each file immediately after download:
    • bb.exebleachbit_console.exe
    • adwcleaner.exeadwcleaner.exe
    • SophosVirusRemovalToolSetup.exesophosscan.exe
  2. Copies renamed files into their corresponding TRON11 tool folders:
    • bleachbit_console.exeC:\TRON11\tools\bleachbit
    • adwcleaner.exeC:\TRON11\tools\adwcleaner
    • sophosscan.exeC:\TRON11\tools\sophos
  3. Verifies that each file exists after copying and logs success or failure for each tool.
  4. Deletes leftover downloaded files from %USERPROFILE%\Downloads to keep the folder clean.

PHASE 1b – System Restore Checkpoint

  1. Creates a Windows System Restore Point named “TRON11 Pre-Cleanup” using PowerShell:
    • This provides a rollback option before any cleanup, scan, or repair begins.
Checkpoint-Computer -Description 'TRON11 Pre-Cleanup' -RestorePointType 'MODIFY_SETTINGS'
  1. Logs success or failure of restore point creation.

PHASE 2 – Verification of Tools

  1. Verifies all essential tools exist in their correct locations:
    • BleachBit (bleachbit_console.exe)
    • AdwCleaner (adwcleaner.exe)
    • Sophos (sophosscan.exe)
  2. Lists any missing tools in the log and console (but continues running, skipping missing ones).
    Example output:
    • This helps you identify download or permission issues early.
[!] Missing: Sophos

PHASE 2b – Cleanup & System Maintenance

  1. Deletes temporary files from:
    • %TEMP%
    • C:\Windows\Temp
  2. Runs system file and integrity checks (with logs):
    • sfc /scannow → repairs corrupted Windows system files
    • chkdsk C: /scan → checks for disk errors (read-only mode)
    • DISM /Online /Cleanup-Image /RestoreHealth → restores component store health
  3. Launches malware and junk cleaning tools in silent/automated mode:
    • BleachBit cleans caches and temporary data silently
    • AdwCleaner removes adware without reboot
    • Sophos scans for malware silently (if installed)
  4. Performs deep system cleanup and optimization:
    • Stops Windows Update service (wuauserv)
    • Deletes old update cache in C:\Windows\SoftwareDistribution
    • Restarts the service
    • Runs disk defragmentation on C: (defrag C: /O)
    • Flushes DNS cache (ipconfig /flushdns)
    • Deletes old restore points (vssadmin delete shadows /all /quiet)

PHASE 3 – Final Cleanup or Retention

  1. If “Keep Files” is not selected:
    • Stops Windows Update, BITS, and Cryptographic services
    • Deletes the entire C:\TRON11 folder and its subfolders
    • Restarts the stopped services
    • Logs confirmation of full cleanup
  2. If “Keep Files” is selected:
    • Leaves all TRON11 folders and tools in place for reuse
    • Logs that files were retained

PHASE 4 – Completion

  1. Writes a final message to the console and (if enabled) to the log:
TRON11 Master Script Complete!
Log saved to Desktop\TRON11_Log.txt
  1. Pauses for user review (unless AUTO_RUN was selected).
  2. Exits cleanly, returning control to the user.

🔒 Summary of What It Does for You

CategoryPurpose
SetupPrepares folders and downloads necessary cleaning tools.
ProtectionCreates a restore point in case you need to roll back.
VerificationEnsures all third-party tools exist before continuing.
CleanupRemoves junk, temporary files, and caches safely.
RepairFixes Windows corruption and disk issues (SFC, DISM, CHKDSK).
ScanUses BleachBit, AdwCleaner, and Sophos for junk/adware/malware cleaning.
OptimizationDefrags drive, resets Windows Update cache, flushes DNS.
LoggingCreates a full log of everything done on your desktop.
Cleanup/RetentionRemoves or keeps the TRON11 folders as you choose.

Leave a Comment

Scroll to Top