anchor.diff:  	type "%ProgramData%\Sophos\Sophos Virus Removal Tool\Logs\SophosVirusRemovalTool.log" >> "%LOGPATH%\%LOGFILE%"
   	if exist "%ProgramData%\Sophos\Sophos Virus Removal Tool\Logs\SophosVirusRemovalTool.log" del /f /q "%ProgramData%\Sophos\Sophos Virus Removal Tool\Logs\SophosVirusRemovalTool.log" 2>NUL
   	)
  -echo %CUR_DATE% %TIME%    Done.>> "%LOGPATH%\%LOGFILE%"
  -echo %CUR_DATE% %TIME%    Done.
  +call :log Done.
   
   
   :: JOB: VIPRE Rescue
   :: Haven't been able to figure out where Vipre saves its log file to, so we can't grab it like with do with Sophos above
   :: We have to pushd and popd here because Vipre tries to stage its definition files in the current directory
  -echo %CUR_DATE% %TIME%    Launch job 'Vipre rescue scanner' (slow, be patient)...>> "%LOGPATH%\%LOGFILE%"
  -echo %CUR_DATE% %TIME%    Launch job 'Vipre rescue scanner' (slow, be patient)...
  +call :log Launch job 'Vipre rescue scanner' (slow, be patient)...
   pushd stage_3_disinfect\vipre_rescue
  -echo %CUR_DATE% %TIME%    Scan in progress. Output hidden by default (use -v to show)...>> "%LOGPATH%\%LOGFILE%"
  -echo %CUR_DATE% %TIME%    Scan in progress. Output hidden by default (use -v to show)...
  +call :log Scan in progress. Output hidden by default (use -v to show)...
   if /i %DRY_RUN%==no ( 
   	if /i %VERBOSE%==no VipreRescueScanner.exe /nolog
   	if /i %VERBOSE%==yes VipreRescueScanner.exe
   	)
   popd
  -echo %CUR_DATE% %TIME%    Done.>> "%LOGPATH%\%LOGFILE%"
  -echo %CUR_DATE% %TIME%    Done.
  -
  +call :log Done.
   
   :: AV scans finished
  -echo %CUR_DATE% %TIME%    Done.>> "%LOGPATH%\%LOGFILE%"
  -echo %CUR_DATE% %TIME%    Done.
  +call :log Done.
   :skip_antivirus_scans
   
   
   :: JOB: Check Windows Image for corruptions before running SFC (Windows 8/2012 only)
   :: Thanks to /u/nomaddave
  -echo %CUR_DATE% %TIME%    Launch job 'Dism Windows image check (Win8/2012 only)'...>> "%LOGPATH%\%LOGFILE%"
  -echo %CUR_DATE% %TIME%    Launch job 'Dism Windows image check (Win8/2012 only)'...
  +call :log Launch job 'Dism Windows image check (Win8/2012 only)'...
   if /i %DRY_RUN%==yes goto skip_dism_image_check
   
   :: Read WIN_VER and run the scan if we're on some derivative of 8 or 2012
  
positive.code: 		stage_0_prep\log_tools\everything\everything.exe -create-filelist %LOGPATH%\tron_raw_logs\filelist-before.txt %SystemDrive%
  	)
  )
  echo %CUR_DATE% %TIME%    Done.>> "%LOGPATH%\%LOGFILE%"
  echo %CUR_DATE% %TIME%    Done.
  
  
  
  :: JOB: rkill
  echo %CUR_DATE% %TIME%    Launch job 'rkill'...>> "%LOGPATH%\%LOGFILE%"
  echo %CUR_DATE% %TIME%    Launch job 'rkill'...
  if /i %DRY_RUN%==no (
  	stage_0_prep\rkill\explorer.exe -s -l "%TEMP%\tron_rkill.log"
  	type "%TEMP%\tron_rkill.log" >> "%LOGPATH%\%LOGFILE%" 2>NUL
  	del "%TEMP%\tron_rkill.log" 2>NUL
  	if exist "%HOMEDRIVE%\%HOMEPATH%\Desktop\Rkill.txt" del "%HOMEDRIVE%\%HOMEPATH%\Desktop\Rkill.txt" 2>NUL
  	)
  echo %CUR_DATE% %TIME%    Done.>> "%LOGPATH%\%LOGFILE%"
  echo %CUR_DATE% %TIME%    Done.
  
  
  :: JOB: ProcessKiller
  echo %CUR_DATE% %TIME%    Launch Job 'ProcessKiller'...>> "%LOGPATH%\%LOGFILE%"
  echo %CUR_DATE% %TIME%    Launch Job 'ProcessKiller'...
  if /i %DRY_RUN%==no stage_0_prep\processkiller\ProcessKiller.exe
  echo %CUR_DATE% %TIME%    Done.>> "%LOGPATH%\%LOGFILE%"
  echo %CUR_DATE% %TIME%    Done.
  
  
  :: JOB: Check WMI and repair if necessary
  echo %CUR_DATE% %TIME%    Checking WMI...>> "%LOGPATH%\%LOGFILE%"
  echo %CUR_DATE% %TIME%    Checking WMI...
  if /i %DRY_RUN%==yes goto skip_repair_wmi
  
  %WMIC% timezone >NUL
  if /i not %ERRORLEVEL%==0 (
      echo %CUR_DATE% %TIME% !  WMI appears to be broken. Running WMI repair. This might take a minute, please be patient...>> "%LOGPATH%\%LOGFILE%"
      echo %CUR_DATE% %TIME% !  WMI appears to be broken. Running WMI repair. This might take a minute, please be patient...
      net stop winmgmt
      pushd %SystemRoot%\system32\wbem
      for %%i in (*.dll) do RegSvr32 -s %%i
  
negative.code: :: Stamp current stage so we can resume if we get interrupted by a reboot
  echo stage_5_optimize>tron_stage.txt
  title TRON v%SCRIPT_VERSION% [stage_5_optimize]
  call :log_heading stage_5_optimize jobs begin...
  
  :: JOB: chkdsk the system drive
  call :log Launch job 'chkdsk'...
  call :log Checking %SystemDrive% for errors...
  
  :: Run a read-only scan and look for errors. Schedule a scan at next reboot if errors found
  if /i %DRY_RUN%==no %SystemRoot%\System32\chkdsk.exe %SystemDrive%
  if /i not %ERRORLEVEL%==0 ( 
  	call :log_alert Errors found on %SystemDrive%. Scheduling full chkdsk at next reboot.
  	if /i %DRY_RUN%==no fsutil dirty set %SystemDrive%
  ) else (
  	call :log No errors found on %SystemDrive%. Skipping full chkdsk at next reboot.
  	)
  	
  call :log Done.
  
  
  :: Check if we are supposed to run a defrag before doing this section
  if "%SKIP_DEFRAG%"=="yes" (
  	call :log SKIP_DEFRAG ^(-sd^) set. Skipping defrag.
  	goto stage_6_wrap-up
  	)
  
  :: Check if a Solid State hard drive was detected before doing this section
  if "%SSD_DETECTED%"=="yes" (
  	call :log Solid State hard drive detected. Skipping job 'Defrag %SystemDrive%'.
  	goto stage_6_wrap-up
  	)
  
  :: JOB: Defrag the system drive
  if "%SSD_DETECTED%"=="no" (
  	call :log Launch job 'Defrag %SystemDrive%'...
  	if /i %DRY_RUN%==no stage_5_optimize\defrag\defraggler.exe %SystemDrive%
  	call :log Done.
  	)
  
  call :log_heading stage_5_optimize jobs complete.
  
  
  ::::::::::::::::::::::
  