60 lines
2.3 KiB
Batchfile
60 lines
2.3 KiB
Batchfile
@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 Adobe Acrobat to Default PDF Viewer
|
|
echo Setting Adobe Acrobat to Default PDF Viewer... >> "%LOGFILE%"
|
|
powershell -ExecutionPolicy Bypass -File "C:\Scripts\Login\DefaultApp-Adobe.ps1"
|
|
|
|
:: Set Google Chrome to Default Browser
|
|
echo Setting Google Chrome to Default Browser... >> "%LOGFILE%"
|
|
powershell -ExecutionPolicy Bypass -File "C:\Scripts\Login\DefaultApp-Chrome.ps1"
|
|
|
|
:: Set ImageGlass to Default Photo Viewer
|
|
echo Setting ImageGlass to Default Photo Viewer... >> "%LOGFILE%"
|
|
powershell -ExecutionPolicy Bypass -File "C:\Scripts\Login\DefaultApp-ImageGlass.ps1"
|
|
|
|
:: 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 |