OneDrive 설치 방지, Microsft Edge 바로가기 생성 방지
윈도우 설치시 SetupComplete.bat을 이용하여 예약된 저장소 생성, OneDrive 설치, Microsoft Edge 바탕화면 바로가기 생성 방지를 적용하는 방법을 적용해 보았습니다. 아래 배치 파일 참고하여 적용해 보시기 바랍니다.
[ 참고 링크 ]
https://admx.help/?Category=EdgeChromium&Policy=Microsoft.Policies.Update::Pol_DefaultCreateDesktopShortcut
https://learn.microsoft.com/en-us/deployedge/microsoft-edge-update-policies#createdesktopshortcutdefault
[ 적용 샘플 ]
@echo off
color 1f
cls
echo.
REM 예약된 저장소 비활성화
:ReservedStorage
for /f "tokens=3 delims=.]" %%a in ('ver') do set build=%%a
if %build% GEQ 18362 (reg add HKLM\Software\Microsoft\Windows\CurrentVersion\ReserveManager /v ShippedWithReserves /t reg_dword /d 0 /f)
GOTO OneDriveRemove
REM OneDrive 설치 방지
:OneDriveRemove
Reg Load "HKU\LoadedDefaultUser" "%SystemDrive%\Users\Default\NTUSER.DAT" 1>NUL
Reg Delete "HKU\LoadedDefaultUser\Software\Microsoft\Windows\CurrentVersion\Run" /v "OneDriveSetup" /f 1>NUL
DEL /f "%SystemDrive%\Users\Default\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\OneDrive.lnk" 2>NUL
Reg UnLoad "HKU\LoadedDefaultUser" 1>NUL
GOTO EdgeDesktopShortcut
REM 바탕화면 Microsoft Edge 바로가기 생성 방지
:EdgeDesktopShortcut
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EdgeUpdate" /v "CreateDesktopShortcutDefault" /t REG_DWORD /d 0 /f
GOTO DefenderExclusion
REM Defender 예외 폴더, 파일 추가
:DefenderExclusion
START Powershell -nologo -noninteractive -windowStyle hidden -noprofile -command ^
Add-MpPreference -ExclusionPath "'C:\Users\Public\Desktop'" -Force; ^
Add-MpPreference -ExclusionPath "'C:\Users\Public\Desktop\Tools'" -Force; ^
Add-MpPreference -ExclusionPath "%SystemRoot%\system32\SppExtComObjHook.dll" 1>NUL
GOTO END
:END
exit