anchor.diff:  :: Purpose:       Temp file cleanup
   :: Requirements:  Admin access helps but is not required
   :: Author:        reddit.com/user/vocatus ( vocatus.gate at gmail ) // PGP key: 0x07d1490f82a211a2
  -:: Version:       3.6.0 + Add additional cleaning procedures to Vista+ block from tron edition of TempFileCleanup. Thanks to github:bknickelbine
  +:: Version:       3.7.0 * Improve logging significantly. Wrap all references to %LOGPATH% and %LOGFILE% in quotes (to protect against paths or file names with spaces or special characters), and add logging to many commands that were previously dumping to NUL. Thanks to github:kezxo for the suggestion
  +::                3.6.0 + Add additional cleaning procedures to Vista+ block from tron edition of TempFileCleanup. Thanks to github:bknickelbine
   ::                3.5.9 + Add removal of "%WINDIR%\System32\tourstart.exe" on Windows XP. Thanks to /u/Perma_dude
   ::                3.5.8 ! Move IE ClearMyTracksByProcess to Vista and up section (does not run on XP/2003)
   ::                3.5.7 * Add /u/neonicacid's suggestion to purge leftover NVIDIA driver installation files
  
positive.code: :: so if we don't find "Microsoft" in the first 9 characters we can safely assume we're not on XP/2k3.
  if /i "%WIN_VER:~0,9%"=="Microsoft" (
  	for /D %%x in ("%SystemDrive%\Documents and Settings\*") do (
  		del /F /Q "%%x\Local Settings\Temp\*" 2>NUL
  		del /F /Q "%%x\Recent\*" 2>NUL
  		del /F /Q "%%x\Local Settings\Temporary Internet Files\*" 2>NUL
  		del /F /Q "%%x\Local Settings\Application Data\ApplicationHistory\*" 2>NUL
  		del /F /Q "%%x\My Documents\*.tmp" 2>NUL
  		del /F /Q "%%x\Application Data\Sun\Java\*" 2>NUL
  		del /F /Q "%%x\Application Data\Adobe\Flash Player\*" 2>NUL
  		del /F /Q "%%x\Application Data\Macromedia\Flash Player\*" 2>NUL
  	)
  ) else (
  	for /D %%x in ("%SystemDrive%\Users\*") do (
  		del /F /S /Q "%%x\*.blf" 2>NUL
  		del /F /S /Q "%%x\*.regtrans-ms" 2>NUL
  		del /F /S /Q "%%x\AppData\LocalLow\Sun\Java\*" 2>NUL
  		del /F /S /Q "%%x\AppData\Local\Google\Chrome\User Data\Default\Cache\*" 2>NUL
  		del /F /S /Q "%%x\AppData\Local\Google\Chrome\User Data\Default\JumpListIconsOld\*" 2>NUL
  		del /F /S /Q "%%x\AppData\Local\Google\Chrome\User Data\Default\JumpListIcons\*" 2>NUL
  		del /F /S /Q "%%x\AppData\Local\Google\Chrome\User Data\Default\Local Storage\http*.*" 2>NUL
  		del /F /S /Q "%%x\AppData\Local\Google\Chrome\User Data\Default\Media Cache\*" 2>NUL
  		del /F /S /Q "%%x\AppData\Local\Microsoft\Internet Explorer\Recovery\*" 2>NUL
  		del /F /S /Q "%%x\AppData\Local\Microsoft\Terminal Server Client\Cache\*" 2>NUL
  		del /F /S /Q "%%x\AppData\Local\Microsoft\Windows\Caches\*" 2>NUL
  		del /F /S /Q "%%x\AppData\Local\Microsoft\Windows\Explorer\*" 2>NUL
  		del /F /S /Q "%%x\AppData\Local\Microsoft\Windows\History\low\*" /AH 2>NUL
  		del /F /S /Q "%%x\AppData\Local\Microsoft\Windows\INetCache\*" 2>NUL
  		del /F /S /Q "%%x\AppData\Local\Microsoft\Windows\Temporary Internet Files\*" 2>NUL
  		del /F /S /Q "%%x\AppData\Local\Microsoft\Windows\WebCache\*" 2>NUL
  		del /F /S /Q "%%x\AppData\Local\Temp\*" 2>NUL
  		del /F /S /Q "%%x\AppData\Roaming\Adobe\Flash Player\*" 2>NUL
  		del /F /S /Q "%%x\AppData\Roaming\Macromedia\Flash Player\*" 2>NUL
  		del /F /S /Q "%%x\AppData\Roaming\Microsoft\Windows\Recent\*" 2>NUL
  		del /F /S /Q "%%x\Recent\*" 2>NUL
  		del /F /Q "%%x\Documents\*.tmp" 2>NUL
  		:: Internet Explorer cleanup
  		rundll32.exe inetcpl.cpl,ClearMyTracksByProcess 4351
  	)
  
negative.code: 
  
  echo. && echo   Done. && echo.
  echo. >> "%LOGPATH%\%LOGFILE%" && echo   Done.>> "%LOGPATH%\%LOGFILE%" && echo. >>%LOGPATH%\%LOGFILE%
  
  
  
  