anchor.diff:  echo stage_1_tempclean>tron_stage.txt
   title TRON v%SCRIPT_VERSION% [stage_1_tempclean]
   call :log "%CUR_DATE% %TIME%   stage_1_tempclean jobs begin..."
  -
  -
  -:: JOB: Clean Internet Explorer; Windows built-in method. Only works on Vista and up
  -if /i not "%WIN_VER:~0,9%"=="Microsoft" (
  -	title TRON v%SCRIPT_VERSION% [stage_1_tempclean] [Clean Internet Explorer]
  -	call :log "%CUR_DATE% %TIME%    Launch job 'Clean Internet Explorer'..."
  -	if /i %DRY_RUN%==no rundll32.exe inetcpl.cpl,ClearMyTracksByProcess 4351
  -	call :log "%CUR_DATE% %TIME%    Done."
  -)
  -
  -
  -:: JOB: TempFileCleanup.bat
  -title TRON v%SCRIPT_VERSION% [stage_1_tempclean] [TempFileCleanup]
  -call :log "%CUR_DATE% %TIME%    Launch job 'TempFileCleanup'..."
  -if /i %DRY_RUN%==no call stage_1_tempclean\tempfilecleanup\TempFileCleanup.bat >> "%LOGPATH%\%LOGFILE%" 2>NUL
  -:: Reset window title since TempFileCleanup clobbers it
  -title TRON v%SCRIPT_VERSION% [stage_1_tempclean]
  -call :log "%CUR_DATE% %TIME%    Done."
  -
  -
  -:: JOB: CCLeaner
  -title TRON v%SCRIPT_VERSION% [stage_1_tempclean] [CCleaner]
  -call :log "%CUR_DATE% %TIME%    Launch job 'CCleaner'..."
  -if /i %DRY_RUN%==no (
  -	start "" /wait stage_1_tempclean\ccleaner\ccleaner.exe /auto>> "%LOGPATH%\%LOGFILE%" 2>NUL
  -	ping 127.0.0.1 -n 12 >NUL
  -	)
  -call :log "%CUR_DATE% %TIME%    Done."
  -
  -
  -:: JOB: BleachBit
  -title TRON v%SCRIPT_VERSION% [stage_1_tempclean] [BleachBit]
  -call :log "%CUR_DATE% %TIME%    Launch job 'BleachBit'..."
  -if /i %DRY_RUN%==no (
  -	if %VERBOSE%==yes stage_1_tempclean\bleachbit\bleachbit_console.exe -p --preset
  -	stage_1_tempclean\bleachbit\bleachbit_console.exe --preset -c >> "%LOGPATH%\%LOGFILE%" 2>NUL
  -	ping 127.0.0.1 -n 12 >NUL
  -	)
  -call :log "%CUR_DATE% %TIME%    Done."
  -
  -
  -:: JOB: USB Device Cleanup
  -title TRON v%SCRIPT_VERSION% [stage_1_tempclean] [USB Device Cleanup]
  -call :log "%CUR_DATE% %TIME%    Launch job 'USB Device Cleanup'..."
  -if /i %DRY_RUN%==no (
  -if /i '%PROCESSOR_ARCHITECTURE%'=='AMD64' (
  -	if %VERBOSE%==yes "stage_1_tempclean\usb_cleanup\DriveCleanup x64.exe" -t -n
  -	"stage_1_tempclean\usb_cleanup\DriveCleanup x64.exe" -n >> "%LOGPATH%\%LOGFILE%" 2>NUL
  -) else (
  -	if %VERBOSE%==yes "stage_1_tempclean\usb_cleanup\DriveCleanup x86.exe" -t -n
  -	"stage_1_tempclean\usb_cleanup\DriveCleanup x86.exe" -n >> "%LOGPATH%\%LOGFILE%" 2>NUL
  -	)
  -)
  -call :log "%CUR_DATE% %TIME%    Done."
  -
  -
  -:: JOB: Clear Windows event logs
  -title TRON v%SCRIPT_VERSION% [stage_1_tempclean] [Clear Windows Event Logs]
  -call :log "%CUR_DATE% %TIME%    Launch job 'Clear Windows event logs'..."
  -if /i %SKIP_EVENT_LOG_CLEAR%==yes (
  -	call :log "%CUR_DATE% %TIME% ! SKIP_EVENT_LOG_CLEAR ^(-se^) set. Skipping Event Log clear."
  -	goto skip_event_log_clear
  -	)
  -call :log "%CUR_DATE% %TIME%    Saving logs to "%BACKUPS%" first..."
  -:: Backup all logs first. Redirect error output to NUL (2>nul) because due to the way WMI formats lists, there is
  -:: a trailing blank line which messes up the last iteration of the FOR loop, but we can safely suppress errors from it
  -SETLOCAL ENABLEDELAYEDEXPANSION
  -if /i %DRY_RUN%==no for /f %%i in ('%WMIC% nteventlog where "filename like '%%'" list instance') do %WMIC% nteventlog where "filename like '%%%%i%%'" backupeventlog "%BACKUPS%\%%i.evt" >> "%LOGPATH%\%LOGFILE%" 2>NUL
  -ENDLOCAL DISABLEDELAYEDEXPANSION
  -call :log "%CUR_DATE% %TIME%    Backups done, now clearing..."
  -:: Clear the logs
  -if /i %DRY_RUN%==no %WMIC% nteventlog where "filename like '%%'" cleareventlog >> "%LOGPATH%\%LOGFILE%"
  -:: Alternate Vista-and-up only method
  -:: if /i %DRY_RUN%==no for /f %%x in ('wevtutil el') do wevtutil cl "%%x" 2>NUL
  -
  -call :log "%CUR_DATE% %TIME%    Done."
  -:skip_event_log_clear
  -
  -
  -
  -:: JOB: Clear Windows Update cache
  -title TRON v%SCRIPT_VERSION% [stage_1_tempclean] [Clear Windows Update cache]
  -call :log "%CUR_DATE% %TIME%    Launch job 'Clear Windows Update cache'..."
  -if /i %DRY_RUN%==no (
  -	:: Allow us to start the service in Safe Mode. Thanks to /u/GrizzlyWinter
  -	reg add "HKLM\SYSTEM\CurrentControlSet\Control\SafeBoot\%SAFEBOOT_OPTION%\WUAUSERV" /ve /t reg_sz /d Service /f >> "%LOGPATH%\%LOGFILE%" 2>&1
  -	net stop WUAUSERV >> "%LOGPATH%\%LOGFILE%" 2>&1
  -	if exist %windir%\softwaredistribution\download rmdir /s /q %windir%\softwaredistribution\download >> "%LOGPATH%\%LOGFILE%" 2>&1
  -	net start WUAUSERV >> "%LOGPATH%\%LOGFILE%" 2>&1
  -	)
  -call :log "%CUR_DATE% %TIME%    Done."
  -
  -
  +call stage_1_tempclean\stage_1_tempclean.bat
   call :log "%CUR_DATE% %TIME%   stage_1_tempclean jobs complete."
   
   
  
positive.code: call :log "-------------------------------------------------------------------------------"
  call :log "%CUR_DATE% %TIME%   TRON v%SCRIPT_VERSION% (%SCRIPT_DATE%) complete"
  call :log "                          OS: %WIN_VER% (%PROCESSOR_ARCHITECTURE%)"
  call :log "                          Executed as %USERDOMAIN%\%USERNAME% on %COMPUTERNAME%
  call :log "                          Command-line flags: %*"
  call :log "                          Safe Mode: %SAFE_MODE% %SAFEBOOT_OPTION%"
  call :log "                          Free space before Tron run: %FREE_SPACE_BEFORE% MB"
  
negative.code: echo stage_4_repair>tron_stage.txt
  title TRON v%SCRIPT_VERSION% [stage_4_repair]
  call :log "%CUR_DATE% %TIME%   stage_4_repair jobs begin..."
  call stage_4_repair\stage_4_repair.bat
  call :log "%CUR_DATE% %TIME%   stage_4_repair jobs complete."
  
  :: Set current date again, since Stage 4 can take quite a while to run
  call :set_cur_date
  
  
  
  