anchor.diff:  echo stage_6_optimize>tron_stage.txt
   title TRON v%SCRIPT_VERSION% [stage_6_optimize]
   call :log "%CUR_DATE% %TIME%   stage_6_optimize jobs begin..."
  -
  -
  -:: JOB: Reset the system page file settings
  -title TRON v%SCRIPT_VERSION% [stage_6_optimize] [pageReset]
  -if /i not %SKIP_PAGEFILE_RESET%==yes (
  -	call :log "%CUR_DATE% %TIME%    Resetting page file settings to Windows defaults..."
  -	if /i %DRY_RUN%==no %WMIC% computersystem where name="%computername%" set AutomaticManagedPagefile=True >> "%LOGPATH%\%LOGFILE%" 2>&1
  -	call :log "%CUR_DATE% %TIME%    Done."
  -) else (
  -	call :log "%CUR_DATE% %TIME% !  SKIP_PAGEFILE_RESET (-spr) set. Skipping page file reset"
  -)
  -
  -
  -:: Check if we are supposed to run a defrag before doing the section below
  -if "%SKIP_DEFRAG%"=="yes" (
  -	call :log "%CUR_DATE% %TIME%    SKIP_DEFRAG (-sd) set. Skipping defrag."
  -	call :log "%CUR_DATE% %TIME%   stage_6_optimize jobs complete."
  -	goto stage_7_wrap-up
  -	)
  -
  -:: Check if a Solid State hard drive was detected before doing the section below
  -if "%SSD_DETECTED%"=="yes" (
  -	call :log "%CUR_DATE% %TIME%    Solid State hard drive detected. Skipping job 'Defrag %SystemDrive%'."
  -	call :log "%CUR_DATE% %TIME%   stage_6_optimize jobs complete."
  -	goto stage_7_wrap-up
  -	)
  -
  -:: JOB: Defrag the system drive
  -if "%SSD_DETECTED%"=="no" (
  -	title TRON v%SCRIPT_VERSION% [stage_6_optimize] [Defrag]
  -	call :log "%CUR_DATE% %TIME%    Launch job 'Defrag %SystemDrive%'..."
  -	if /i %DRY_RUN%==no stage_6_optimize\defrag\defraggler.exe %SystemDrive% /MinPercent 5
  -	call :log "%CUR_DATE% %TIME%    Done."
  -	call :log "%CUR_DATE% %TIME%   stage_6_optimize jobs complete."
  -	)
  +call stage_6_optimize\stage_6_optimize.bat
  +call :log "%CUR_DATE% %TIME%   stage_6_optimize jobs complete."
  +
   
   
   ::::::::::::::::::::::
  
positive.code: :: Stamp current stage so we can resume if we get interrupted by a reboot
  echo stage_3_disinfect>tron_stage.txt
  title TRON v%SCRIPT_VERSION% [stage_3_disinfect]
  call :log "%CUR_DATE% %TIME%   stage_3_disinfect jobs begin..."
  
  
  :: JOB: Check for -sa flag (skip ALL antivirus scans) and skip RogueKiller, Sophos, KVRT and MBAM if it was used
  if /i %SKIP_ANTIVIRUS_SCANS%==yes (
  	call :log "%CUR_DATE% %TIME% ! SKIP_ANTIVIRUS_SCANS ^(-sa^) set. Skipping Sophos, KVRT and MBAM scans."
  	goto skip_antivirus_scans
  	)
  
  
  REM :: JOB: RogueKiller
  REM title TRON v%SCRIPT_VERSION% [stage_3_disinfect] [RogueKiller]
  REM call :log "%CUR_DATE% %TIME%    Launch job 'RogueKiller' (it is SLOW, be patient)..."
  REM if /i %DRY_RUN%==no (
      REM start stage_3_disinfect\roguekiller\RogueKillerAutomation.exe
      REM if /i %VERBOSE%==yes stage_3_disinfect\roguekiller\RogueKillerCMD.exe -scan
      REM if /i %VERBOSE%==no stage_3_disinfect\roguekiller\RogueKillerCMD.exe -scan>> "%LOGPATH%\%LOGFILE%"
      REM )
  REM call :log "%CUR_DATE% %TIME%    Done."
  
  
  :: JOB: MBAM (MalwareBytes Anti-Malware)
  title TRON v%SCRIPT_VERSION% [stage_3_disinfect] [Malwarebytes Anti-Malware]
  if exist "%ProgramFiles(x86)%\Malwarebytes Anti-Malware\mbam.exe" (
  	call :log "%CUR_DATE% %TIME% !  Malwarebytes installation detected. Skipping MBAM installation."
  	goto skip_mbam
  )
  if /i %SKIP_MBAM_INSTALL%==yes (
  	call :log "%CUR_DATE% %TIME% ! SKIP_MBAM_INSTALL (-sm) set. Skipping MBAM installation."
  ) else (
  	call :log "%CUR_DATE% %TIME%    Launch job 'Install Malwarebytes Anti-Malware'..."
  	:: Install MBAM & remove the desktop icon
  	if /i %DRY_RUN%==no (
  		"stage_3_disinfect\mbam\Malwarebytes Anti-Malware v2.1.8.1057.exe" /verysilent
  		::"Malwarebytes Anti-Malware v1.75.0.1300.exe" /SP- /VERYSILENT /NORESTART /SUPPRESSMSGBOXES /NOCANCEL
  		if exist "%PUBLIC%\Desktop\Malwarebytes Anti-Malware.lnk" del "%PUBLIC%\Desktop\Malwarebytes Anti-Malware.lnk"
  		if exist "%USERPROFILE%\Desktop\Malwarebytes Anti-Malware.lnk" del "%USERPROFILE%\Desktop\Malwarebytes Anti-Malware.lnk"
  		if exist "%ALLUSERSPROFILE%\Desktop\Malwarebytes Anti-Malware.lnk" del "%ALLUSERSPROFILE%\Desktop\Malwarebytes Anti-Malware.lnk"
  
  		:: Scan for and launch appropriate architecture version
  		if exist "%ProgramFiles(x86)%\Malwarebytes Anti-Malware" (
  			start "" "%ProgramFiles(x86)%\Malwarebytes Anti-Malware\mbam.exe"
  		) else (
  			start "" "%ProgramFiles%\Malwarebytes Anti-Malware\mbam.exe"
  			)
  	)
  	call :log "%CUR_DATE% %TIME%    Done."
  	call :log "%CUR_DATE% %TIME% !  NOTE: You must manually click SCAN in the MBAM window!"
  )
  :skip_mbam
  
  
  :: JOB: Kaspersky Virus Removal Tool (KVRT)
  title TRON v%SCRIPT_VERSION% [stage_3_disinfect] [Kaspersky VRT]
  if /i %SKIP_KASPERSKY_SCAN%==yes (
  	call :log "%CUR_DATE% %TIME% ! SKIP_KASPERSKY_SCAN (-sk) set. Skipping KVRT scan."
  ) else (
  	call :log "%CUR_DATE% %TIME%    Launch job 'Kaspersky Virus Removal Tool'..."
  	call :log "%CUR_DATE% %TIME%    Tool-specific log saved to "%RAW_LOGS%\Reports""
  	if /i %DRY_RUN%==no (
  		start /wait stage_3_disinfect\kaspersky_virus_removal_tool\KVRT.exe -d "%RAW_LOGS%" -accepteula -adinsilent -silent -processlevel 2 -dontcryptsupportinfo
  		if exist "%RAW_LOGS%\Legal notices" rmdir /s /q "%RAW_LOGS%\Legal notices"
  		)
  	call :log "%CUR_DATE% %TIME%    Done."
  )
  
  
  :: JOB: Sophos Virus Remover
  title TRON v%SCRIPT_VERSION% [stage_3_disinfect] [Sophos Virus Remover]
  if /i %SKIP_SOPHOS_SCAN%==yes (
  	call :log "%CUR_DATE% %TIME% ! SKIP_SOPHOS_SCAN (-ss) set. Skipping SAV scan."
  ) else (
  	call :log "%CUR_DATE% %TIME%    Launch job 'Sophos Virus Removal Tool' (slow, be patient)..."
  	call :log "%CUR_DATE% %TIME%    Scanning. Output REDUCED by default (use -v to show)..."
  	if /i %DRY_RUN%==no (
  		echo.
  		if exist "%ProgramData%\Sophos\Sophos Virus Removal Tool\Logs\SophosVirusRemovalTool.log" del /f /q "%ProgramData%\Sophos\Sophos Virus Removal Tool\Logs\SophosVirusRemovalTool.log" >nul 2>&1
  		if /i %VERBOSE%==no	stage_3_disinfect\sophos_virus_remover\svrtcli.exe -yes
  		if /i %VERBOSE%==yes stage_3_disinfect\sophos_virus_remover\svrtcli.exe -yes -debug
  		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" >nul 2>&1
  		)
  	call :log "%CUR_DATE% %TIME%    Done."
  )
  
  :: AV scans finished
  :skip_antivirus_scans
  call :log "%CUR_DATE% %TIME%   stage_3_disinfect jobs complete."
  
  :: Since this whole section takes a long time to run, set the date again in case we crossed over midnight during the scans
  :: This is a half-hearted fix for now. Thanks to /u/ScubaSteve for finding the bug
  call :set_cur_date
  
  
  
negative.code: :::::::::::::::::::::
  cls
  color 0f
  set SCRIPT_VERSION=7.3.0
  set SCRIPT_DATE=2015-12-xx
  title TRON v%SCRIPT_VERSION% (%SCRIPT_DATE%)
  
  