@echo off setlocal EnableDelayedExpansion :: Script to configure default file associations, remove OneDrive, disable Edge, and launch Google Drive :: Created: 2024-11-21 :: Set up logging set "LOGFILE=%TEMP%\tcse-login-script.log" set "LOGFILE=%LOGFILE: =0%" echo Starting setup script at %DATE% %TIME% > "%LOGFILE%" :: Set App Defaults echo Setting Default Apps... >> "%LOGFILE%" C:\Scripts\Software\setuserfta.exe .pdf AcroExch.Document C:\Scripts\Software\setuserfta.exe .htm ChromeHTML C:\Scripts\Software\setuserfta.exe .html ChromeHTML C:\Scripts\Software\setuserfta.exe http ChromeHTML C:\Scripts\Software\setuserfta.exe https ChromeHTML C:\Scripts\Software\setuserfta.exe .mhtml ChromeHTML C:\Scripts\Software\setuserfta.exe .svg ChromeHTML C:\Scripts\Software\setuserfta.exe .xht ChromeHTML C:\Scripts\Software\setuserfta.exe .xhtml ChromeHTML :: Run Debloat Script powershell -ExecutionPolicy Bypass -File "C:\Scripts\Software\Win11Debloat\Win11Debloat.ps1" -Silent -RemoveW11Outlook -DisableTelemetry -DisableBing -DisableSuggestions -DisableLockscreenTips -ShowKnownFileExt :: Disable OneDrive Startup echo Disable OneDrive Startup... >> "%LOGFILE%" powershell -ExecutionPolicy Bypass -File "C:\Scripts\Login\Disable-OneDriveStartup.ps1" :: Disable Edge Startup echo Disable Edge Startup... >> "%LOGFILE%" powershell -ExecutionPolicy Bypass -File "C:\Scripts\Login\Disable-EdgeStartup.ps1" :: Remove Edge Desktop Shortcut echo Remove Edge Desktop Shortcut... >> "%LOGFILE%" powershell -ExecutionPolicy Bypass -File "C:\Scripts\Login\Remove-EdgeShortcut.ps1" :: Launch Google Drive for Desktop :: Check if Google Drive File Stream is already set to launch on startup reg query "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v "GoogleDriveFS" >nul 2>&1 if %errorlevel% equ 0 ( echo Google Drive File Stream is already set to launch on startup. >> "%LOGFILE%" ) else ( echo Launching Google Drive for Desktop... >> "%LOGFILE%" start /B "" "C:\Program Files\Google\Drive File Stream\launch.bat" :: Wait for Google Drive to launch timeout /t 5 /nobreak > nul ) :: Uninstall OneDrive echo Uninstall OneDrive... >> "%LOGFILE%" "C:\Scripts\Login\Uninstall-OneDrive.bat" echo Script completed at %DATE% %TIME% >> "%LOGFILE%" echo Log file created at: %LOGFILE% endlocal