anchor.diff:  :: Version checks
   if %WIN_VER_NUM% geq 6.2 set TARGET_METRO=yes
   if /i %PRESERVE_METRO_APPS%==yes set TARGET_METRO=no
  -if /i %DRY_RUN%==no net start AppXSVC >nul 2>&1
   if /i %TARGET_METRO%==yes (
   	call functions\log.bat "%CUR_DATE% %TIME%    Windows 8 or higher detected, removing OEM Metro apps..."
   	:: Force allowing us to start AppXSVC service in Safe Mode. AppXSVC is the MSI Installer equivalent for "apps" (vs. programs)
   	if /i %DRY_RUN%==no (
   		REM Enable starting AppXSVC in Safe Mode
  -		reg add "HKLM\SYSTEM\CurrentControlSet\Control\SafeBoot\%SAFEBOOT_OPTION%\AppXSVC" /ve /t reg_sz /d Service /f >nul 2>&1
  +		if /i "%SAFE_MODE%"=="yes" reg add "HKLM\SYSTEM\CurrentControlSet\Control\SafeBoot\%SAFEBOOT_OPTION%\AppXSVC" /ve /t reg_sz /d Service /f >nul 2>&1
   		net start AppXSVC >nul 2>&1
   		REM Enable scripts in PowerShell
   		powershell "Set-ExecutionPolicy Unrestricted -force 2>&1 | Out-Null"
   
  -		REM Do the removal
  -		if /i not "%WIN_VER:~0,9%"=="Windows 1" (
  -
  -			REM Windows 8/8.1 version
  +		REM Windows 8/8.1 version
  +		if /i "%WIN_VER:~0,9%"=="Windows 8" (
   			REM In Windows 8/8.1 we can blast ALL AppX/Metro/"Modern App" apps because unlike in Windows 10, the "core" apps (calculator, paint, etc) aren't in the "modern" format
   			powershell "Get-AppXProvisionedPackage -online | Remove-AppxProvisionedPackage -online 2>&1 | Out-Null"
   			powershell "Get-AppxPackage -AllUsers | Remove-AppxPackage 2>&1 | Out-Null"
  -
  -		) else (
  -
  -			REM Windows 10 version
  -			REM Kill forced OneDrive integration
  -			taskkill /f /im OneDrive.exe >> "%LOGPATH%\%LOGFILE%" 2>&1
  -			%SystemRoot%\System32\OneDriveSetup.exe /uninstall >> "%LOGPATH%\%LOGFILE%" >nul 2>&1
  -			%SystemRoot%\SysWOW64\OneDriveSetup.exe /uninstall >> "%LOGPATH%\%LOGFILE%" >nul 2>&1
  -			REM These keys are orphaned after the OneDrive uninstallation and can be safely removed
  -			reg delete "HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f >> "%LOGPATH%\%LOGFILE%" 2>&1
  -			reg delete "HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f >> "%LOGPATH%\%LOGFILE%" 2>&1
  -			takeown /f "%LocalAppData%\Microsoft\OneDrive" /r /d y >> "%LOGPATH%\%LOGFILE%" 2>&1
  -			icacls "%LocalAppData%\Microsoft\OneDrive" /grant administrators:F /t >> "%LOGPATH%\%LOGFILE%" 2>&1
  -			rmdir /s /q "%LocalAppData%\Microsoft\OneDrive" >> "%LOGPATH%\%LOGFILE%" 2>&1
  -			rmdir /s /q "%ProgramData%\Microsoft OneDrive" >> "%LOGPATH%\%LOGFILE%" 2>&1
  -			rmdir /s /q "%SystemDrive%\OneDriveTemp" >> "%LOGPATH%\%LOGFILE%" 2>&1
  -
  +		)
  +		REM Windows 10 version
  +		if /i "%WIN_VER:~0,9%"=="Windows 1" (
   			REM Call the external PowerShell scripts to do removal of Microsoft and 3rd party OEM Modern Apps
   			powershell -executionpolicy bypass -file ".\stage_2_de-bloat\metro\metro_3rd_party_modern_apps_to_target_by_name.ps1"
   			powershell -executionpolicy bypass -file ".\stage_2_de-bloat\metro\metro_Microsoft_modern_apps_to_target_by_name.ps1"
  
positive.code: 	pause
  	exit /b 1
  )
  	
  	
  	
  :::::::::::::::::::::::
  :: STAGE 2: De-Bloat :: // Begin jobs
  :::::::::::::::::::::::
  
negative.code: )
  
  
  :: JOB: Remove forced OneDrive integration
  if /i "%WIN_VER:~0,9%"=="Windows 1" (
  	call functions\log.bat "%CUR_DATE% %TIME%    Checking if OneDrive is in use, please wait..."
  	for /F %%i in ('dir /b "%USERPROFILE%\OneDrive\*.*"') do (
  		call functions\log.bat "%CUR_DATE% %TIME% !  OneDrive appears to be in use. Skipping removal."
  		goto skip_onedrive_removal
  	)
  		call functions\log.bat "%CUR_DATE% %TIME%    OneDrive doesn't appear to be in use. Removing..."
  			taskkill /f /im OneDrive.exe >> "%LOGPATH%\%LOGFILE%" 2>&1
  			ping 127.0.0.1 -n 5 > NUL 2>&1
  			%SystemRoot%\System32\OneDriveSetup.exe /uninstall >> "%LOGPATH%\%LOGFILE%" >nul 2>&1
  			%SystemRoot%\SysWOW64\OneDriveSetup.exe /uninstall >> "%LOGPATH%\%LOGFILE%" >nul 2>&1
  			ping 127.0.0.1 -n 7 > NUL 2>&1
  			takeown /f "%LocalAppData%\Microsoft\OneDrive" /r /d y >> "%LOGPATH%\%LOGFILE%" 2>&1
  			icacls "%LocalAppData%\Microsoft\OneDrive" /grant administrators:F /t >> "%LOGPATH%\%LOGFILE%" 2>&1
  			rmdir /s /q "%LocalAppData%\Microsoft\OneDrive" >> "%LOGPATH%\%LOGFILE%" 2>&1
  			rmdir /s /q "%ProgramData%\Microsoft OneDrive" >> "%LOGPATH%\%LOGFILE%" 2>&1
  			rmdir /s /q "%SystemDrive%\OneDriveTemp" >> "%LOGPATH%\%LOGFILE%" 2>&1
  			REM These two registry entries disable OneDrive links in the Explorer side pane
  			reg add "HKCR\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /v System.IsPinnedToNameSpaceTree /t reg_dword /d 0 /f >> "%LOGPATH%\%LOGFILE%" 2>&1
  			reg add "HKCR\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /v System.IsPinnedToNameSpaceTree /t reg_dword /d 0 /f >> "%LOGPATH%\%LOGFILE%" 2>&1
  		call functions\log.bat "%CUR_DATE% %TIME%   Done."
  )
  :skip_onedrive_removal
  
  
  :: Stage complete
  call functions\log.bat "%CUR_DATE% %TIME%   stage_2_de-bloat complete."
  