anchor.diff:  echo %CUR_DATE% %TIME%   Launching stage_0_prep jobs...
   
   :: JOB: rkill
  -echo %CUR_DATE% %TIME%   Launching job 'rkill'...>> "%LOGPATH%\%LOGFILE%"
  -echo %CUR_DATE% %TIME%   Launching job 'rkill'...
  +echo %CUR_DATE% %TIME%    Launching job 'rkill'...>> "%LOGPATH%\%LOGFILE%"
  +echo %CUR_DATE% %TIME%    Launching job 'rkill'...
   pushd rkill
  -if '%PROCESSOR_ARCHITECTURE%'=='AMD64' rkill64.exe -s -l "%LOGPATH%\tron_rkill.log"
  -if '%PROCESSOR_ARCHITECTURE%'=='x86' rkill.exe -s -l "%LOGPATH%\tron_rkill.log"
  -type "%LOGPATH%\tron_rkill.log" >> "%LOGPATH%\%LOGFILE%"
  -del "%LOGPATH%\tron_rkill.log"
  -popd
  -echo %CUR_DATE% %TIME%   Done.>> "%LOGPATH%\%LOGFILE%"
  -echo %CUR_DATE% %TIME%   Done.
  +	if not "%DRY_RUN%"=="no" goto skip_rkill
  +	if '%PROCESSOR_ARCHITECTURE%'=='AMD64' rkill64.exe -s -l "%LOGPATH%\tron_rkill.log"
  +	if '%PROCESSOR_ARCHITECTURE%'=='x86' rkill.exe -s -l "%LOGPATH%\tron_rkill.log"
  +	type "%LOGPATH%\tron_rkill.log" >> "%LOGPATH%\%LOGFILE%"
  +	del "%LOGPATH%\tron_rkill.log"
  +:skip_rkill
  +popd
  +echo %CUR_DATE% %TIME%    Done.>> "%LOGPATH%\%LOGFILE%"
  +echo %CUR_DATE% %TIME%    Done.
   
   :: JOB: Disable sleep mode
  -echo %CUR_DATE% %TIME%   Disabling Sleep mode...>> "%LOGPATH%\%LOGFILE%"
  -echo %CUR_DATE% %TIME%   Disabling Sleep mode...
  +echo %CUR_DATE% %TIME%    Disabling Sleep mode...>> "%LOGPATH%\%LOGFILE%"
  +echo %CUR_DATE% %TIME%    Disabling Sleep mode...
   pushd disable_sleep
  -:: Check for Windows XP and run the appropriate powercfg command
  -if "%WIN_VER%"=="xp2k3" (powercfg /SETACTIVE "Always On") else (powercfg /SETACTIVE 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c)
  -popd
  -echo %CUR_DATE% %TIME%   Done.>> "%LOGPATH%\%LOGFILE%"
  -echo %CUR_DATE% %TIME%   Done.
  +if not "%DRY_RUN%"=="no" goto skip_disable_sleep
  +
  +echo %CUR_DATE% %TIME%    Exporting current power scheme and switching to Always On...>> "%LOGPATH%\%LOGFILE%"
  +echo %CUR_DATE% %TIME%    Exporting current power scheme and switching to Always On...
  +
  +:: Export the current power scheme to a file. Thanks to reddit.com/user/GetOnMyAmazingHorse
  +setlocal enabledelayedexpansion
  +if "%WIN_VER%"=="xp2k3" (
  +	:: Extract the line containing the current power GUID
  +	for /f "delims=^T" %%i in ('powercfg -query ^| find /i "Name"') do (set t=%%i)
  +	:: Parse out just the name and stash it in a variable
  +	set POWER_SCHEME=!t:~27!
  +	:: Export the power scheme based on this GUID
  +	powercfg /EXPORT "!POWER_SCHEME!" /FILE %LOGPATH%\tron_power_config_backup.pow
  +	:: Set the "High Performance" scheme active
  +	powercfg /SETACTIVE "Always On"
  +) else (
  +	:: Extract the line containing the current power GUID
  +	for /f "delims=" %%i in ('powercfg -list ^| find "*"') do (set t=%%i)
  +	:: Parse out just the GUID and stash it in a variable
  +	set POWER_SCHEME=!t:~19,36!
  +	:: Export the power scheme based on this GUID
  +	powercfg /EXPORT %LOGPATH%\tron_power_config_backup.pow !POWER_SCHEME!
  +	:: Set the "High Performance" scheme active
  +	powercfg /SETACTIVE 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
  +	)
  +:: This cheats a little bit by stacking the set command on the same line as the endlocal so it executes immediately after ENDLOCAL but before the variable gets wiped out by the endlocal. Kind of a little trick to get a SETLOCAL-internal variable exported to a global script-wide variable.
  +:: We need the POWER_SCHEME GUID for later when we re-import everything
  +endlocal disabledelayedexpansion && set POWER_SCHEME=%POWER_SCHEME%
  +
  +echo %CUR_DATE% %TIME%    Done.>> "%LOGPATH%\%LOGFILE%"
  +echo %CUR_DATE% %TIME%    Done.
  +
  +:skip_disable_sleep
  +popd
  +echo %CUR_DATE% %TIME%    Done.>> "%LOGPATH%\%LOGFILE%"
  +echo %CUR_DATE% %TIME%    Done.
   
   :: JOB: Check and Repair WMI if it's broken
  -echo %CUR_DATE% %TIME%   Checking WMI...>> "%LOGPATH%\%LOGFILE%"
  -echo %CUR_DATE% %TIME%   Checking WMI...
  +echo %CUR_DATE% %TIME%    Checking WMI...>> "%LOGPATH%\%LOGFILE%"
  +echo %CUR_DATE% %TIME%    Checking WMI...
   pushd repair_wmi
  +if not "%DRY_RUN%"=="no" goto skip_repair_wmi
   
   :: Do a quick check to make sure WMI is working, and if not, repair it
   wmic timezone >NUL
   if 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...
  +    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 %WINDIR%\system32\wbem
       for %%i in (*.dll) do RegSvr32 -s %%i
  
positive.code: echo %CUR_DATE% %TIME%   Wrapping up...>> "%LOGPATH%\%LOGFILE%"
  echo %CUR_DATE% %TIME%   Wrapping up...
  
  echo %CUR_DATE% %TIME%   Resetting power settings to their defaults...>> "%LOGPATH%\%LOGFILE%"
  echo %CUR_DATE% %TIME%   Resetting power settings to their defaults...
  :: Check for XP and run the appropriate version of the command
  if "%WIN_VER%"=="xp2k3" (powercfg /RestoreDefaultPolicies) else (powercfg -restoredefaultschemes)
  echo %CUR_DATE% %TIME%   Done.>> "%LOGPATH%\%LOGFILE%"
  echo %CUR_DATE% %TIME%   Done.
  
  title TRON v%VERSION% [DONE]
  
  echo %CUR_DATE% %TIME%   DONE. Use the tools in resources\stage_6_manual_tools if further cleaning is required.>> "%LOGPATH%\%LOGFILE%"
  echo %CUR_DATE% %TIME%   DONE. Use the tools in resources\stage_6_manual_tools if further cleaning is required.
  echo %CUR_DATE% %TIME%   Logfile is located at %LOGPATH%\%LOGFILE%>> "%LOGPATH%\%LOGFILE%"
  echo %CUR_DATE% %TIME%   Logfile is located at %LOGPATH%\%LOGFILE%
  
  if "%AUTO_REBOOT_DELAY%"=="0" (
  	echo %CUR_DATE% %TIME% ! Auto-reboot disabled. Recommend rebooting as soon as possible.>> "%LOGPATH%\%LOGFILE%"
  	echo %CUR_DATE% %TIME% ! Auto-reboot disabled. Recommend rebooting as soon as possible.
  ) else (
  	echo %CUR_DATE% %TIME% ! Rebooting in %AUTO_REBOOT_DELAY% seconds.>> "%LOGPATH%\%LOGFILE%"
  	echo %CUR_DATE% %TIME% ! Rebooting in %AUTO_REBOOT_DELAY% seconds.
  	)
  
  :: Create the log trailer for this job
  
negative.code: 	popd
  	)
  
  :skip_jre_update
  echo %CUR_DATE% %TIME%    Done.>> "%LOGPATH%\%LOGFILE%"
  echo %CUR_DATE% %TIME%    Done.
  
  :: JOB: Notepad++
  echo %CUR_DATE% %TIME%    Launching job 'Update Notepad++'...>> "%LOGPATH%\%LOGFILE%"
  echo %CUR_DATE% %TIME%    Launching job 'Update Notepad++'...
  pushd notepad++\v6.6.8
  if not "%DRY_RUN%"=="no" goto skip_notepad
  setlocal
  call "npp.Installer.bat"
  endlocal
  :skip_notepad
  popd
  echo %CUR_DATE% %TIME%    Done.>> "%LOGPATH%\%LOGFILE%"
  echo %CUR_DATE% %TIME%    Done.
  
  :: JOB: Windows updates
  echo %CUR_DATE% %TIME%    Launching job 'Install Windows updates'...>> "%LOGPATH%\%LOGFILE%"
  echo %CUR_DATE% %TIME%    Launching job 'Install Windows updates'...
  pushd windows_updates
  if "%DRY_RUN%"=="no" wuauclt /detectnow /updatenow
  popd
  echo %CUR_DATE% %TIME%    Done.>> "%LOGPATH%\%LOGFILE%"
  echo %CUR_DATE% %TIME%    Done.
  
  popd
  echo %CUR_DATE% %TIME%   Completed stage_4_patch jobs.>> "%LOGPATH%\%LOGFILE%"
  