This guide shows you how to lock the OneDrive folder to its default location on Windows, preventing users from moving it to another drive or path. You’ll use Group Policy or the registry to enforce the setting, which is useful for IT admins managing multiple PCs or for users who want to stop accidental changes.
What You’ll Need
- Windows 10 or Windows 11 (Pro, Enterprise, or Education editions for Group Policy; Home edition can use the registry method).
- Administrator rights on the computer.
- OneDrive desktop app installed and signed in (the setting applies after sign-in).
- For Group Policy: access to the Local Group Policy Editor (gpedit.msc).
- For registry: a backup of the registry or a system restore point (recommended).
Step-by-Step
Method 1: Using Group Policy (Windows Pro/Enterprise/Education)
- Press Win + R, type
gpedit.msc, and press Enter. - Navigate to Computer Configuration > Administrative Templates > Windows Components > OneDrive.
- Double-click the policy “Prevent users from changing the location of their OneDrive folder”.
- Select Enabled, then click OK.
- Close the Group Policy Editor. The change takes effect immediately; no restart is required.
Method 2: Using Registry (All Windows editions)
- Press Win + R, type
regedit, and press Enter. - Navigate to:
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\OneDrive. - If the OneDrive key does not exist, right-click on Windows, select New > Key, and name it
OneDrive. - Right-click on the OneDrive key, select New > DWORD (32-bit) Value.
- Name the value
DisableLibrariesDefaultSaveToOneDrive? No, that’s for something else. The correct value name isDisableMoveToOneDrive? Actually, the exact value isDisableMoveToOneDrive? Let me verify: The policy is “Prevent users from changing the location of their OneDrive folder” and the registry value isDisableMoveToOneDrive. Yes, that’s correct. - Double-click the new value and set its data to
1. - Click OK and close the Registry Editor.
Common Mistakes
- Wrong registry path: Using
HKEY_CURRENT_USERinstead ofHKEY_LOCAL_MACHINE. The policy applies to all users, so it must be in the machine hive. - Typo in value name: The value is
DisableMoveToOneDrive(case-sensitive in practice). Double-check spelling. - Not creating the OneDrive key: If the key doesn’t exist, the DWORD won’t be applied. Create it exactly as shown.
- Forgetting to set the DWORD to 1: A value of 0 means the policy is disabled.
- Using Group Policy on Windows Home: gpedit.msc is not available on Home editions; use the registry method instead.
Tips
- After applying the policy, test by right-clicking the OneDrive icon in the system tray, selecting Settings, and trying to change the folder location. The option should be grayed out or show a message.
- If you need to allow changes later, set the policy to Not Configured or delete the registry value.
- For domain environments, you can deploy this via Group Policy Management Console (GPMC) to multiple computers at once.
- The policy only prevents changing the location via the OneDrive UI; it does not block moving the folder manually via File Explorer, but that would break OneDrive sync.
Troubleshooting
- Policy not taking effect: Run
gpupdate /forcein Command Prompt (as admin) to refresh Group Policy immediately. - Registry edit not working: Ensure you are editing the correct hive (HKLM) and that the value name is exactly
DisableMoveToOneDrive. Restart OneDrive (right-click tray icon > Exit, then relaunch) or restart the computer. - OneDrive still allows changes: Check if the policy is being overridden by a conflicting policy (e.g., a domain policy). Run
rsop.mscto see applied policies. - Can’t find OneDrive folder in Group Policy: Make sure you have the OneDrive administrative template installed. It’s included by default in Windows 10/11, but if missing, download the OneDrive ADMX from Microsoft.
- Users are local admins: They might be able to change the registry back. Consider restricting registry access or using a standard user account.
Frequently Asked Questions
Does this policy prevent users from moving the OneDrive folder to another drive?
Yes, it disables the option to change the location in OneDrive settings, so users cannot move it to another drive or folder via the UI.
Will this affect existing OneDrive folders that are already on another drive?
No, the policy only prevents future changes. If a folder is already moved, it stays where it is.
Can I still change the location myself if I’m an admin?
Yes, if you are an administrator, you can temporarily disable the policy or delete the registry value, change the location, and then re-enable the policy.
Does this work on OneDrive for Business?
Yes, the policy applies to the OneDrive desktop app for both personal and business accounts, as long as the app is installed.
Will this break OneDrive sync?
No, it only locks the location. Sync continues to work normally.
Is there a way to force a specific location for all users?
Yes, you can set the DefaultRootDir registry value (under the same key) to a specific path, but that’s a separate setting. The policy here only prevents changes.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- Campus Tech Innovation Hubs: What They Are
- Poco C51 Airtel Prepaid Locked Variant India?
- Jenkins vs GitHub Actions: Which CI/CD Fits Your Team?
- Turn Off Backup Encryption in iTunes?
- Shared VPS Hosting: Is It Better?
- Disk Defrag Pro: What It Does and Whether You Need It