anchor.diff:  :: Requirements:  1. Administrator access
   ::                2. Safe mode is recommended but not required
   :: Author:        vocatus on reddit.com/r/TronScript ( vocatus.gate at gmail ) // PGP key: 0x07d1490f82a211a2
  -:: Version:       1.1.8 * Update date/time logging functions to use new log_with_date.bat. Thanks to /u/DudeManFoo for suggestion
  +:: Version:       1.1.9 * Preface WMIC calls with null input to ensure the pipe is closed, fixes issue with WMI hanging on WinXP machines. Thanks to github:salsifis
  +::                        Relevant pull: https://github.com/bmrf/tron/pull/108
  +::                1.1.8 * Update date/time logging functions to use new log_with_date.bat. Thanks to /u/DudeManFoo
   ::                1.1.7 * script:     Update script to support standalone execution
   ::                1.1.6 ! duplicates: Fix broken duplicate file cleanup of Downloads folder due to accidentally putting quote markes around the path to the profile list text file
   ::                1.1.5 ! ccleaner:   Add /f (force) switch to ccleaner task kill command. Thanks to /u/iseijin
  
positive.code: 		"stage_1_tempclean\usb_cleanup\DriveCleanup x86.exe" -n >> "%LOGPATH%\%LOGFILE%" 2>NUL
  	)
  )
  call functions\log_with_date.bat "    Done."
  
  
  :: JOB: Clear Windows event logs
  title Tron v%TRON_VERSION% [stage_1_tempclean] [Clear Windows Event Logs]
  call functions\log_with_date.bat "    Launch job 'Clear Windows event logs'..."
  if /i %SKIP_EVENT_LOG_CLEAR%==yes (
  	call functions\log_with_date.bat " ! SKIP_EVENT_LOG_CLEAR ^(-se^) set. Skipping Event Log clear."
  	goto skip_event_log_clear
  )
  call functions\log_with_date.bat "     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 ('^<NUL %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 functions\log_with_date.bat "     Backups done, now clearing..."
  :: Clear the logs
  if /i %DRY_RUN%==no <NUL %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 functions\log_with_date.bat "    Done."
  :skip_event_log_clear
  
  
  
  :: JOB: Clear Windows Update cache
  title Tron v%TRON_VERSION% [stage_1_tempclean] [Clear Windows Update cache]
  call functions\log_with_date.bat "    Launch job 'Clear Windows Update cache'..."
  if /i %DRY_RUN%==no (
  	:: Allow us to start the service in Safe Mode
  	if %SAFE_MODE%==yes reg add "HKLM\SYSTEM\CurrentControlSet\Control\SafeBoot\%SAFEBOOT_OPTION%\WUAUSERV" /ve /t reg_sz /d Service /f >> "%LOGPATH%\%LOGFILE%" 2>&1
  
negative.code: :::::::::::::::::::::
  :: PREP AND CHECKS ::
  :::::::::::::::::::::
  set STAGE_1_SCRIPT_VERSION=1.1.9
  set STAGE_1_SCRIPT_DATE=2017-06-20
  
  :: Check for standalone vs. Tron execution and build the environment if running in standalone mode
  if /i "%LOGFILE%"=="" (
  