mirror of
https://github.com/ChrisTitusTech/winutil
synced 2026-04-06 14:48:31 +00:00
* updated theme to the latest version * Update en.yaml * removed all the order from the docs * add the store link * update homepage * add filename and line number to all the code blocks and also removed pages * auto pull the code from the json files * Merge branch 'main' into winutil-new-features * the script updated linenostart= * Delete LaptopHibernation.md
42 lines
1.4 KiB
Markdown
42 lines
1.4 KiB
Markdown
---
|
|
title: "Remove OneDrive"
|
|
description: ""
|
|
---
|
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=1469}
|
|
"WPFTweaksRemoveOneDrive": {
|
|
"Content": "Remove OneDrive",
|
|
"Description": "Denys permission to remove onedrive user files than uses its own uninstaller to remove it than brings back permissions",
|
|
"category": "z__Advanced Tweaks - CAUTION",
|
|
"panel": "1",
|
|
"InvokeScript": [
|
|
"
|
|
# Deny permission to remove OneDrive folder
|
|
icacls $Env:OneDrive /deny \"Administrators:(D,DC)\"
|
|
|
|
Write-Host \"Uninstalling OneDrive...\"
|
|
Start-Process 'C:\\Windows\\System32\\OneDriveSetup.exe' -ArgumentList '/uninstall' -Wait
|
|
|
|
# Some of OneDrive files use explorer, and OneDrive uses FileCoAuth
|
|
Write-Host \"Removing leftover OneDrive Files...\"
|
|
Stop-Process -Name FileCoAuth,Explorer
|
|
Remove-Item \"$Env:LocalAppData\\Microsoft\\OneDrive\" -Recurse -Force
|
|
Remove-Item \"C:\\ProgramData\\Microsoft OneDrive\" -Recurse -Force
|
|
|
|
# Grant back permission to accses OneDrive folder
|
|
icacls $Env:OneDrive /grant \"Administrators:(D,DC)\"
|
|
|
|
# Disable OneSyncSvc
|
|
Set-Service -Name OneSyncSvc -StartupType Disabled
|
|
"
|
|
],
|
|
"UndoScript": [
|
|
"
|
|
Write-Host \"Installing OneDrive\"
|
|
winget install Microsoft.Onedrive --source winget
|
|
|
|
# Enabled OneSyncSvc
|
|
Set-Service -Name OneSyncSvc -StartupType Enabled
|
|
"
|
|
],
|
|
```
|