Remove OneDrive startup entry (#4253)

* Remove Onedrive startup entry

* Merge branch 'ChrisTitusTech:main' into patch-1

* Merge branch 'ChrisTitusTech:main' into patch-1

* Merge branch 'main' into patch-1
This commit is contained in:
Gabi
2026-04-02 12:28:06 -07:00
committed by GitHub
parent bc2f6ce8f7
commit 1cd918cbe1

View File

@@ -199,6 +199,9 @@ function Invoke-WinUtilISOScript {
& icacls "$ScratchDir\Windows\System32\OneDriveSetup.exe" /grant "$($adminGroup.Value):(F)" /T /C | Out-Null & icacls "$ScratchDir\Windows\System32\OneDriveSetup.exe" /grant "$($adminGroup.Value):(F)" /T /C | Out-Null
Remove-Item -Path "$ScratchDir\Windows\System32\OneDriveSetup.exe" -Force -ErrorAction SilentlyContinue Remove-Item -Path "$ScratchDir\Windows\System32\OneDriveSetup.exe" -Force -ErrorAction SilentlyContinue
# Remove OneDrive from startup registry
Remove-ISOScriptReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\Run\OneDrive'
# ── 4. Registry tweaks ──────────────────────────────────────────────────── # ── 4. Registry tweaks ────────────────────────────────────────────────────
& $Log "Loading offline registry hives..." & $Log "Loading offline registry hives..."
reg load HKLM\zCOMPONENTS "$ScratchDir\Windows\System32\config\COMPONENTS" reg load HKLM\zCOMPONENTS "$ScratchDir\Windows\System32\config\COMPONENTS"