Apps Enable or Disable OneDrive in Windows 11


OneDrive_banner.png

This tutorial will show you how to enable or disable the OneDrive feature for all users in Windows 10 and Windows 11.

OneDrive is built-in to Windows 11 by default.

With OneDrive, you can sync files and folders between your computer and the cloud, so you can get to your files from anywhere - your computer, your mobile device, and even through the OneDrive website at OneDrive.live.com. If you add, change, or delete a file or folder in your OneDrive folder, the file or folder is added, changed, or deleted on the OneDrive website and vice versa. You can work with your synced files directly in File Explorer and access your files even when you’re offline. Whenever you’re online, any changes that you or others make will sync automatically.

If you like, you can disable OneDrive in Windows 11.

If you disable OneDrive integration:
  • Users can’t open OneDrive.
  • OneDrive will not run at startup for all users.
  • Microsoft Store apps can’t access OneDrive using the WinRT API.
  • OneDrive doesn’t appear in the navigation pane in File Explorer for all users.
  • OneDrive files aren’t kept in sync with the cloud.
  • Users can’t automatically upload photos and videos from the camera roll folder.
Reference:


You must be signed in as an administrator to enable or disable the OneDrive feature in Windows.

Disabling OneDrive in Windows 11 does not delete or remove the C:\Users\<username>\OneDrive folder for users.

Disabling OneDrive in Windows 11 does not prevent users from using OneDrive.com online in their web browser.


To fully disable OneDrive, it is recommend to turn off OneDrive backup for any folders before disabling OneDrive.



Contents

  • Option One: Enable or Disable OneDrive in Local Group Policy Editor
  • Option Two: Enable or Disable OneDrive using REG file


EXAMPLE: OneDrive enabled and disabled in Windows 11

One_Drive_enabled.png

One_Drive_disabled.png





Option One

Enable or Disable OneDrive in Local Group Policy Editor


The Local Group Policy Editor is only available in the Windows 11 Pro, Enterprise, and Education editions.

All editions can use Option Two.


1 Open the Local Group Policy Editor (gpedit.msc).

2 Navigate to the policy location below in the left pane of the Local Group Policy Editor. (see screenshot below)

Computer Configuration > Administrative Templates > Windows Components > OneDrive

OneDrive_gpedit-1.png

3 In the right pane of OneDrive in the Local Group Policy Editor, double click/tap on the Prevent the usage of OneDrive for file storage policy to edit it. (see screenshot above)

4 Do step 5 (enable) or step 6 (disable) below for what you would like to do.

5 To Enable OneDrive for All Users

This is the default setting.


A) Select (dot) Not Configured, click/tap on OK, and go to step 7 below. (see screenshot below)​

OneDrive_gpedit-2.png

6 To Disable OneDrive for All Users

A) Select (dot) Enabled, click/tap on OK, and go to step 7 below. (see screenshot below)​

OneDrive_gpedit-3.png

7 Close the Local Group Policy Editor if you like.

8 Either sign out and sign in or restart the computer to apply.




Option Two

Enable or Disable OneDrive using REG file


1 Do step 2 (enable) or step 3 (disable) below for what you would like to do.

2 To Enable OneDrive for All Users

This is the default setting.


A) Click/tap on the Download button below to download the file below, and go to step 4 below.​

Enable_OneDrive_for_all_users.reg


(Contents of REG file for reference)
Code:
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\OneDrive]
"DisableFileSyncNGSC"=-

3 To Disable OneDrive for All Users

A) Click/tap on the Download button below to download the file below, and go to step 4 below.​

Disable_OneDrive_for_all_users.reg


(Contents of REG file for reference)
Code:
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\OneDrive]
"DisableFileSyncNGSC"=dword:00000001

4 Save the .reg file to your desktop.

5 Double click/tap on the downloaded .reg file to merge it.

6 When prompted, click/tap on Run, Yes (UAC), Yes, and OK to approve the merge.

7 Either sign out and sign in or restart the computer to apply.

8 You could now delete the downloaded .reg file if you like.


That's it,
Shawn Brink


 

Attachments

Last edited:
Good morning.
I'm working with 24H2 I have irisuccessful in part to delete OneDrive, I say in part because I was left with the shortcut in the start menu.
I also tried putting in the ISO the simple bat command
rd “%LOCALAPPDATA%\Microsoft\OneDrive” /Q /S
But it didn't work, I did a test after completed installation but the folder remains stuck in explorer, only by unlocking the folder , with third party program, I managed to remove the shortcut in start menu.
Any ideas?

Thanks

Immagine-2024-10-29-155150.png
 

My Computer

System One

  • OS
    W11
    Computer type
    PC/Desktop
    CPU
    CPU AMD Ryzen 9 7950X
    Motherboard
    ASUS ROG Strix X670E-F Gaming WiFi
    Memory
    G.Skill Flare X5 32GB Kit DDR5-6000 CL32 (F5-6000J3238F16GX2-FX5)
    Monitor(s) Displays
    LG E2381VR
    Screen Resolution
    1920x1080
    Hard Drives
    1x Samsung Memorie MZ-V8P1T0B 980 PRO SSD 1TB
    2x Western Digital WD Red Nas 4TB
    PSU
    SEASONIC FOCUS PX-850 Plus Platinum
    Case
    Corsair 4000D Airflow
    Cooling
    ARCTIC Liquid Freezer II 280 A-RGB
    Keyboard
    Logitech G510
    Mouse
    Logitech G502 HERO
    Browser
    Firefox
    Antivirus
    Avg free
    Other Info
    Download: 90 Mbps
    Upload: 20Mbps
Good morning.
I'm working with 24H2 I have irisuccessful in part to delete OneDrive, I say in part because I was left with the shortcut in the start menu.
I also tried putting in the ISO the simple bat command
rd “%LOCALAPPDATA%\Microsoft\OneDrive” /Q /S
But it didn't work, I did a test after completed installation but the folder remains stuck in explorer, only by unlocking the folder , with third party program, I managed to remove the shortcut in start menu.
Any ideas?

Thanks

Immagine-2024-10-29-155150.png
Hello, :alien:

Uninstalling OneDrive like below should remove its shortcut.

 

My Computers

System One System Two

  • OS
    Windows 11 Pro for Workstations
    Computer type
    PC/Desktop
    Manufacturer/Model
    Custom self build
    CPU
    Intel i7-8700K 5 GHz
    Motherboard
    ASUS ROG Maximus XI Formula Z390
    Memory
    64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz (F4-3600C18D-32GTZR)
    Graphics Card(s)
    ASUS ROG-STRIX-GTX1080TI-O11G-GAMING (11GB GDDR5X)
    Sound Card
    Integrated Digital Audio (S/PDIF)
    Monitor(s) Displays
    2 x Samsung Odyssey G75 27"
    Screen Resolution
    2560x1440
    Hard Drives
    1TB Samsung 990 PRO M.2,
    4TB Samsung 990 PRO M.2,
    8TB WD MyCloudEX2Ultra NAS
    PSU
    Seasonic Prime Titanium 850W
    Case
    Thermaltake Core P3 wall mounted
    Cooling
    Corsair Hydro H115i
    Keyboard
    Logitech wireless K800
    Mouse
    Logitech MX Master 3
    Internet Speed
    1 Gbps Download and 35 Mbps Upload
    Browser
    Google Chrome
    Antivirus
    Microsoft Defender and Malwarebytes Premium
    Other Info
    Logitech Z625 speaker system,
    Logitech BRIO 4K Pro webcam,
    HP Color LaserJet Pro MFP M477fdn,
    CyberPower CP1500PFCLCD
    Galaxy S23 Plus phone
  • Operating System
    Windows 11 Pro
    Computer type
    Laptop
    Manufacturer/Model
    Surface Laptop 7 Copilot+ PC
    CPU
    Snapdragon X Elite (12 core) 3.42 GHz
    Memory
    16 GB LPDDR5x-7467 MHz
    Monitor(s) Displays
    15" HDR
    Screen Resolution
    2496 x 1664
    Hard Drives
    1 TB SSD
    Internet Speed
    Wi-Fi 7 and Bluetooth 5.4
    Browser
    Chrome and Edge
    Antivirus
    Windows Defender
Thanks, it''s an excellent tutorial very helpful for manual OneDrive removal.
With version 23H2 I had a similar problem which I later solved, but with version 24H2 I can't remove the link via ISO,
I found a script that removes the link altogether, I tried it on installed machine and it works, I have to see if it works inside ISO

Code:
@echo off

set x86="%SYSTEMROOT%\System32\OneDriveSetup.exe"
set x64="%SYSTEMROOT%\SysWOW64\OneDriveSetup.exe"

echo Closing OneDrive process.
echo.
taskkill /f /im OneDrive.exe > NUL 2>&1
ping 127.0.0.1 -n 5 > NUL 2>&1

echo Uninstalling OneDrive.
echo.
if exist %x64% (
%x64% /uninstall
) else (
%x86% /uninstall
)
ping 127.0.0.1 -n 5 > NUL 2>&1

echo Removing OneDrive leftovers.
echo.
rd "%USERPROFILE%\OneDrive" /Q /S > NUL 2>&1
rd "C:\OneDriveTemp" /Q /S > NUL 2>&1
rd "%LOCALAPPDATA%\Microsoft\OneDrive" /Q /S > NUL 2>&1
rd "%PROGRAMDATA%\Microsoft OneDrive" /Q /S > NUL 2>&1

echo Removing OneDrive from the Explorer Side Panel.
echo.
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f > NUL 2>&1
REG DELETE "HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f > NUL 2>&1
exit
 
Last edited:

My Computer

System One

  • OS
    W11
    Computer type
    PC/Desktop
    CPU
    CPU AMD Ryzen 9 7950X
    Motherboard
    ASUS ROG Strix X670E-F Gaming WiFi
    Memory
    G.Skill Flare X5 32GB Kit DDR5-6000 CL32 (F5-6000J3238F16GX2-FX5)
    Monitor(s) Displays
    LG E2381VR
    Screen Resolution
    1920x1080
    Hard Drives
    1x Samsung Memorie MZ-V8P1T0B 980 PRO SSD 1TB
    2x Western Digital WD Red Nas 4TB
    PSU
    SEASONIC FOCUS PX-850 Plus Platinum
    Case
    Corsair 4000D Airflow
    Cooling
    ARCTIC Liquid Freezer II 280 A-RGB
    Keyboard
    Logitech G510
    Mouse
    Logitech G502 HERO
    Browser
    Firefox
    Antivirus
    Avg free
    Other Info
    Download: 90 Mbps
    Upload: 20Mbps
Thanks, it''s an excellent tutorial very helpful for manual OneDrive removal.
With version 23H2 I had a similar problem which I later solved, but with version 24H2 I can't remove the link via ISO, is it possible somehow by inserting a script or key reg directly into the ISO?

Thank you
Not sure about how to include it in the ISO, but hopefully someone may know of a way and post it.
 

My Computers

System One System Two

  • OS
    Windows 11 Pro for Workstations
    Computer type
    PC/Desktop
    Manufacturer/Model
    Custom self build
    CPU
    Intel i7-8700K 5 GHz
    Motherboard
    ASUS ROG Maximus XI Formula Z390
    Memory
    64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz (F4-3600C18D-32GTZR)
    Graphics Card(s)
    ASUS ROG-STRIX-GTX1080TI-O11G-GAMING (11GB GDDR5X)
    Sound Card
    Integrated Digital Audio (S/PDIF)
    Monitor(s) Displays
    2 x Samsung Odyssey G75 27"
    Screen Resolution
    2560x1440
    Hard Drives
    1TB Samsung 990 PRO M.2,
    4TB Samsung 990 PRO M.2,
    8TB WD MyCloudEX2Ultra NAS
    PSU
    Seasonic Prime Titanium 850W
    Case
    Thermaltake Core P3 wall mounted
    Cooling
    Corsair Hydro H115i
    Keyboard
    Logitech wireless K800
    Mouse
    Logitech MX Master 3
    Internet Speed
    1 Gbps Download and 35 Mbps Upload
    Browser
    Google Chrome
    Antivirus
    Microsoft Defender and Malwarebytes Premium
    Other Info
    Logitech Z625 speaker system,
    Logitech BRIO 4K Pro webcam,
    HP Color LaserJet Pro MFP M477fdn,
    CyberPower CP1500PFCLCD
    Galaxy S23 Plus phone
  • Operating System
    Windows 11 Pro
    Computer type
    Laptop
    Manufacturer/Model
    Surface Laptop 7 Copilot+ PC
    CPU
    Snapdragon X Elite (12 core) 3.42 GHz
    Memory
    16 GB LPDDR5x-7467 MHz
    Monitor(s) Displays
    15" HDR
    Screen Resolution
    2496 x 1664
    Hard Drives
    1 TB SSD
    Internet Speed
    Wi-Fi 7 and Bluetooth 5.4
    Browser
    Chrome and Edge
    Antivirus
    Windows Defender
  • Like
Reactions: DMD
Not sure about how to include it in the ISO, but hopefully someone may know of a way and post it.
Read post #28.

You have three options (depending on your technical experience):

1. Mount the install image, remove OneDriveSetup.exe (and its associated tasks and icon) so it doesn't exist. Write changes back to the install.wim. This process is recommended for those familiar with customizing Windows images.

2. Run a set of Unattended commands to remove OneDriveSetup.exe, before it starts installing itself (during OOBE). Schneegan's answer file generator can do this for you.

Code:
takeown /f %SystemRoot%\System32\OneDriveSetup.exe
icacls %SystemRoot%\System32\OneDriveSetup.exe /grant SYSTEM:f
del %SystemRoot%\System32\OneDriveSetup.exe

takeown /f %SystemRoot%\System32\OneDrive.ico
icacls %SystemRoot%\System32\OneDrive.ico /grant SYSTEM:f
del %SystemRoot%\System32\OneDrive.ico

reg delete "HKEY_USERS\S-1-5-19\Software\Microsoft\Windows\CurrentVersion\Run" /v OneDriveSetup /f
reg delete "HKEY_USERS\S-1-5-20\Software\Microsoft\Windows\CurrentVersion\Run" /v OneDriveSetup /f

reg load HKLM\DEFAULT C:\Users\Default\NTUSER.DAT
reg delete HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\Run /v OneDriveSetup /f
reg unload HKLM\DEFAULT

3. Run a post-install removal script. Since OneDrive is already installed, you must kill the process and go clean up all the associated files. This works, but why bother with a longer script when you could have prevented OneDrive from installing?
 

My Computer

System One

  • OS
    Windows 7
Thank you is a very good suggestion, I think step 1 is the right one to execute, only I have no dimestication when mounted the image to remove OneDriveSetup.exe .
 

My Computer

System One

  • OS
    W11
    Computer type
    PC/Desktop
    CPU
    CPU AMD Ryzen 9 7950X
    Motherboard
    ASUS ROG Strix X670E-F Gaming WiFi
    Memory
    G.Skill Flare X5 32GB Kit DDR5-6000 CL32 (F5-6000J3238F16GX2-FX5)
    Monitor(s) Displays
    LG E2381VR
    Screen Resolution
    1920x1080
    Hard Drives
    1x Samsung Memorie MZ-V8P1T0B 980 PRO SSD 1TB
    2x Western Digital WD Red Nas 4TB
    PSU
    SEASONIC FOCUS PX-850 Plus Platinum
    Case
    Corsair 4000D Airflow
    Cooling
    ARCTIC Liquid Freezer II 280 A-RGB
    Keyboard
    Logitech G510
    Mouse
    Logitech G502 HERO
    Browser
    Firefox
    Antivirus
    Avg free
    Other Info
    Download: 90 Mbps
    Upload: 20Mbps
I tried the script in RunOnceEx , but after a few moments after installation, the shortcut reappears in the start menu.
Evidently Windows always re-enables the shortcut, even after uninstallation.

Immagine-2024-10-30-091557.png
 

My Computer

System One

  • OS
    W11
    Computer type
    PC/Desktop
    CPU
    CPU AMD Ryzen 9 7950X
    Motherboard
    ASUS ROG Strix X670E-F Gaming WiFi
    Memory
    G.Skill Flare X5 32GB Kit DDR5-6000 CL32 (F5-6000J3238F16GX2-FX5)
    Monitor(s) Displays
    LG E2381VR
    Screen Resolution
    1920x1080
    Hard Drives
    1x Samsung Memorie MZ-V8P1T0B 980 PRO SSD 1TB
    2x Western Digital WD Red Nas 4TB
    PSU
    SEASONIC FOCUS PX-850 Plus Platinum
    Case
    Corsair 4000D Airflow
    Cooling
    ARCTIC Liquid Freezer II 280 A-RGB
    Keyboard
    Logitech G510
    Mouse
    Logitech G502 HERO
    Browser
    Firefox
    Antivirus
    Avg free
    Other Info
    Download: 90 Mbps
    Upload: 20Mbps
RunOnceEx is too late to run the script. OneDriveSetup.exe runs some point after the specialize pass. Follow the instructions.
 

My Computer

System One

  • OS
    Windows 7
I solved it with the autounattend file generator.

Screenshot-1159.png
 

My Computer

System One

  • OS
    W11
    Computer type
    PC/Desktop
    CPU
    CPU AMD Ryzen 9 7950X
    Motherboard
    ASUS ROG Strix X670E-F Gaming WiFi
    Memory
    G.Skill Flare X5 32GB Kit DDR5-6000 CL32 (F5-6000J3238F16GX2-FX5)
    Monitor(s) Displays
    LG E2381VR
    Screen Resolution
    1920x1080
    Hard Drives
    1x Samsung Memorie MZ-V8P1T0B 980 PRO SSD 1TB
    2x Western Digital WD Red Nas 4TB
    PSU
    SEASONIC FOCUS PX-850 Plus Platinum
    Case
    Corsair 4000D Airflow
    Cooling
    ARCTIC Liquid Freezer II 280 A-RGB
    Keyboard
    Logitech G510
    Mouse
    Logitech G502 HERO
    Browser
    Firefox
    Antivirus
    Avg free
    Other Info
    Download: 90 Mbps
    Upload: 20Mbps

Latest Support Threads

Back
Top Bottom