To prevent users from changing the OneDrive folder location on Windows 11/10, here are two methods you must follow. Although OneDrive allows users to change the default location, you can block other users from doing that on a computer. The default location of OneDrive, in case you do not know, is C:\User\username\OneDrive.
Before getting started, you are advised to collect the Tenant ID. You can visit the Azure Active Directory admin center if you do not know how to find it. Click on this link and sign in with your account to see the Tenant ID.
You can then enable this feature from the Local Group Policy Editor and Registry Editor. However, if you use the first method, you must add OneDrive sync settings to the Local Group Policy Editor.
Prevent users from changing the location of their OneDrive folder
To prevent users from changing the OneDrive folder location using Group Policy Editor, follow these steps-
- Press Win+R to open the Run prompt.
- Type gpedit.msc and hit the Enter button.
- Go to OneDrive in User Configuration.
- Double-click on Prevent users from changing the location of their OneDrive folder.
- Select the Enable option.
- Click on the Show button.
- Enter the Tenant ID in the Value name field.
- Enter 1 in the Value field.
- Click the OK button.
- Click Apply and OK.
Let’s check out these steps in detail.
You will have to open the Local Group Policy Editor. For that, press Win+R, type gpedit.msc
, and hit the Enter button. After that, navigate to this path-
User Configuration > Administrative Templates > OneDrive
Double-click on Prevent users from changing the location of their OneDrive folder and select the Enabled option. Then, click on the Show button.
You must select the Value name field and enter the Tenant ID you copied earlier. Then, select the Value field and enter 1.
After that, click the OK button to return to the previous window. Here, click the Apply and OK buttons, respectively.
The next method is all about Registry changes. Therefore, it is recommended that you create a System Restore point and backup all Registry files.
Block users from changing the default OneDrive folder location using Registry
To block users from changing the default OneDrive folder location using Registry, follow these steps-
- Press Win+R.
- Type regedit and hit the Enter button.
- Click the Yes button in the UAC prompt.
- Navigate to OneDrive in the HKCU.
- Right-click on OneDrive > New > DWORD (32-bit) Value.
- Name it as DisableCustomRoot.
- Double-click on it to set the Value data as 1.
- Right-click on OneDrive > New > Key.
- Name it as DisableCustomRoot.
- Right-click on DisableCustomRoot > New > String Value.
- Name it as the Tenant ID.
- Double-click on it and set the Value data as 1.
- Click OK.
Let’s check out the detailed version of these steps.
At first, you will have to open the Registry Editor. Press Win+R, type regedit, and press the Enter button. If the UAC prompt appears, click the Yes button. Then, navigate to the following path-
HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\OneDrive
If you cannot find the OneDrive folder, right-click on Microsoft > New > Key and name it OneDrive. After that, right-click on OneDrive > New > DWORD (32-bit) Value and name it as DisableCustomRoot.
Double-click on DisableCustomRoot, and set the Value data as 1. Then, right-click OneDrive > New > Key and name it DisableCustomRoot.
Now, right-click DisableCustomRoot > New > String Value and name it your Tenant ID. Double-click on this String Value and set the Value data as 1.
Click the OK button to save changes.
That’s all! I hope this tutorial helps.
How do I lock a folder in Microsoft OneDrive?
There is no way to lock a folder in OneDrive, but you can use the Personal Vault to hide and lock the folder. Personal Vault is a great way to protect the folder from unauthenticated access and save your files from malware that encrypts your files and asks for money.
How do I stop OneDrive from syncing certain folders?
You can go to OneDrive Settings on your Windows PC and unselect the folders you don’t want to sync using the Choose Folders. Remember, they will be uploaded to the cloud but unavailable unless you demand it to download.