Remove OneDrive from startup
- Windows onlyThis script improves your privacy on Windows
- Single actionThis page belongs to a script, containing basic changes to achieve a task.
- Impact: Medium
System Functionality / Data Loss Risk: Moderate
This action improves privacy with minimal impact when you run the recommended script.
This action improves privacy with some impact when you run the recommended script. - Batch (batchfile)These changes use Windows system commands to update your settings.
- Administrator rights requiredThis script requires privilege access to do the system changes
- Fully reversible
You can fully restore this action (revert back to the original behavior) using this website.
The restore/revert methods provided here can help you fix issues.
Overview
OneDrive starts on every boot in both Windows 10 and 11 by default.
It's started through OneDrive
REG_SZ
entry in HKCU\Software\Microsoft\Windows\CurrentVersion\Run
1.
It is found on both Windows 10 (since 21H2, missing in 20H2) and Windows 11 (since 23H2).
The startup command is "<local-app-data>\Microsoft\OneDrive\OneDrive.exe" /background
1.
This script is only recommended if you understand its implications.
Some non-critical or features may no longer function correctly after running this script.
This script can be fully reversed to restore changes if something goes wrong.
Sources
- Launch Microsoft OneDrive with a RemoteApp - Azure Virtual Desktop. Microsoft Learn. learn.microsoft.com. (2024).
Original: https://learn.microsoft.com/en-us/azure/virtual-desktop/onedrive-remoteapp
Archived: https://web.archive.org/web/20241202095156/https://learn.microsoft.com/en-us/azure/virtual-desktop/onedrive-remoteapp
Apply Now
Choose one of three ways to apply:
Download script
Download and run the script directly- No app needed
- Offline usage
- Easy-to-apply
- Free
- Open-source
Help
How to apply or restore "Remove OneDrive from startup" using script
- ≈ 2 min to complete
- Tools: Web Browser
- Difficulty: Simple
- ≈ 5 instructions
- 1
Download
Download the script file by clicking on thebutton above.
Use button above to restore changes. - 2
Keep the file
If warned by your browser, keep the file. - 3
Open
Open the downloaded file. - 4
Exit
Once it's done, press any key to exit the window. - 5
Restart
Restart your computer for all changes to take effect.
Apply with privacy.sexy
Guided, automated application with safety checks- Recommended for most users
- Includes safety checks
- Free
- Open-source
- Popular
- Offline/Online usage
Help
How to apply or restore "Remove OneDrive from startup" using privacy.sexy
- ≈ 3 min to complete
- Tools: privacy.sexy
- Difficulty: Simple
- ≈ 4 instructions
- 2
Choose script
- Search for the script name: Remove OneDrive from startup
- Check the script by clicking on the checkbox.
- 3
Run
Click on ▶️ Run button at the bottom of the page.This button only appears on desktop version (recommended). On browser, use 💾 Save button.
- Apply
- Revert
:: Delete the registry value "OneDrive" from the key "HKCU\Software\Microsoft\Windows\CurrentVersion\Run"
PowerShell -ExecutionPolicy Unrestricted -Command "$keyName = 'HKCU\Software\Microsoft\Windows\CurrentVersion\Run'; $valueName = 'OneDrive'; $hive = $keyName.Split('\')[0]; $path = "^""$($hive):$($keyName.Substring($hive.Length))"^""; Write-Host "^""Removing the registry value '$valueName' from '$path'."^""; if (-Not (Test-Path -LiteralPath $path)) { Write-Host 'Skipping, no action needed, registry key does not exist.'; Exit 0; }; $existingValueNames = (Get-ItemProperty -LiteralPath $path).PSObject.Properties.Name; if (-Not ($existingValueNames -Contains $valueName)) { Write-Host 'Skipping, no action needed, registry value does not exist.'; Exit 0; }; try { if ($valueName -ieq '(default)') { Write-Host 'Removing the default value.'; $(Get-Item -LiteralPath $path).OpenSubKey('', $true).DeleteValue(''); } else { Remove-ItemProperty -LiteralPath $path -Name $valueName -Force -ErrorAction Stop; }; Write-Host 'Successfully removed the registry value.'; } catch { Write-Error "^""Failed to remove the registry value: $($_.Exception.Message)"^""; }"
Ijo6IFJlc3RvcmUgdGhlIHJlZ2lzdHJ5IHZhbHVlIFwiT25lRHJpdmVcIiBpbiBrZXkgXCJIS0NVXFxTb2Z0d2FyZVxcTWljcm9zb2Z0XFxXaW5kb3dzXFxDdXJyZW50VmVyc2lvblxcUnVuXCIgdG8gaXRzIG9yaWdpbmFsIHZhbHVlIFxuUG93ZXJTaGVsbCAtRXhlY3V0aW9uUG9saWN5IFVucmVzdHJpY3RlZCAtQ29tbWFuZCBcIiRkYXRhID0gJ1wiXlwiXCIlTE9DQUxBUFBEQVRBJVxcTWljcm9zb2Z0XFxPbmVEcml2ZVxcT25lRHJpdmUuZXhlXCJeXCJcIiAvYmFja2dyb3VuZCc7IC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bnRpbnVlIHwgU2VsZWN0LU9iamVjdCAtRXhwYW5kUHJvcGVydHkgJHZhbHVlOyBpZiAoJGN1cnJlbnREYXRhIC1lcSAkZGF0YSkgeyBXcml0ZS1Ib3N0ICdTa2lwcGluZywgbm8gY2hhbmdlcyByZXF1aXJlZCwgdGhlIHJlZ2lzdHJ5IGRhdGEgaXMgYWxyZWFkeSBhcyBleHBlY3RlZC4nOyBFeGl0IDA7IH07IHRyeSB7ICR0eXBlID0gc3dpdGNoICgkcmF3VHlwZSkgeyAnUkVHX1NaJyB7ICdTdHJpbmcnIH07ICdSRUdfRFdPUkQnIHsgJ0RXb3JkJyB9OyAnUkVHX1FXT1JEJyB7ICdRV29yZCcgfTsgJ1JFR19FWFBBTkRfU1onIHsgJ0V4cGFuZFN0cmluZycgfTsgZGVmYXVsdCB7IHRocm93IFwiXlwiXCJJbnRlcm5hbCBwcml2YWN5JChbY2hhcl0weDAwMkUpc2V4eSBlcnJvcjogRmFpbGVkIHRvIGZpbmQgZGF0YSB0eXBlIGZvcjogJyRyYXdUeXBlJy5cIl5cIlwiOyB9OyB9OyBTZXQtSXRlbVByb3BlcnR5IC1MaXRlcmFsUGF0aCAkcGF0aCAtTmFtZSAkdmFsdWUgLVZhbHVlICRkYXRhIC1UeXBlICR0eXBlIC1Gb3JjZSAtRXJyb3JBY3Rpb24gU3RvcDsgV3JpdGUtSG9zdCAnU3VjY2Vzc2Z1bGx5IHJlc3RvcmVkIHRoZSByZWdpc3RyeSB2YWx1ZS4nOyB9IGNhdGNoIHsgdGhyb3cgXCJeXCJcIkZhaWxlZCB0byByZXN0b3JlIHRoZSB2YWx1ZTogJCgkXy5FeGNlcHRpb24uTWVzc2FnZSlcIl5cIlwiOyB9XCIi
Help
How to apply or restore "Remove OneDrive from startup" using commands
- ≈ 2 min to complete
- Tools: Command Prompt
- Difficulty: Medium
- ≈ 3 instructions
- 1
Open Command Prompt
Open Command Prompt as Administrator. - 2
Copy code
Copy the code: - 3
Paste & run
Paste the commands into Command Prompt and press Enter to run.Some changes require a system restart to take effect
Similar Guides
Wider Goal
Guides below includes this guide to achieve a wider goal.See other more general settings that includes this one as one of its actions.
These plans combine multiple privacy settings, including this one, for stronger protection.
- Remove OneDrive
- Remove bloatware
Microsoft OneDrive (formerly SkyDrive) is a file hosting service operated by Microsoft. First launched in August 2007, it enables registered users to share and syn...
Remove bloatware — This system calibration provides an easy-to-follow breakdown of how. Besides that, this documentation offers practical insights on the procedure...
Same Goal
Other guides in Remove OneDriveSee settings that are in the same category as this guide.
Using other actions in the same category may help you achieve your goal better.
See all 10 guides
About the Creators
These people have authored this documentation and written its scripts:
Reviewed By
This guide has undergone comprehensive auditing and peer review:Expert review by undergroundwires
- Verified technical accuracy and editorial standards
- Assessed system impact and user privacy risks
Public review by large community
- Privacy enthusiasts and professionals peer-reviewed
- Millions of end-users tested across different environments
History
We continually monitor our guides, their impact and all other privacy options. We update our guides when new information becomes available. On every update, we publicly store who made the change, what has been changed, why the change was made and when the change was made.