Clear OneDrive environment variable
Since Windows 10 1809, Microsoft introduced "%ONEDRIVE%" environment variable to reach OneDrive through an alias. This variable is redundant when OneDrive is undesired. This script deletes "OneDrive" environment variable. "OneDrive" key at "HKCU\\Environment" is found on both Windows 10 (since 21H2, missing in 20H2) and Windows 11 (since 23H2).
Disable automatic OneDrive installation
This script prevents OneDrive from automatically reinstalling itself. OneDrive, Microsoft's cloud storage service, can automatically reinstall itself after being uninstalled on older Windows 10 versions. This is done through a startup entry that runs "OneDriveSetup.exe", which silently installs OneDrive when a user logs in. The script enhances privacy by stopping OneDrive from reinstalling without user consent. This prevents unwanted data collection and synchronization. It also boosts system per...
Disable OneDrive scheduled tasks
This script disables the scheduled tasks associated with Microsoft OneDrive that typically run maintenance activities such as auto-updates and data collection. Disabling these tasks impacts OneDrive's automatic background update process. By default, Windows 10 (since 22H2) and Windows 11 (since 22H2) include the following tasks: "OneDrive Standalone Update Task" • "OneDrive Reporting Task" These tasks are enabled by default and lack official documentation from Microsoft. They can be identified b...
Disable OneDrive usage
This script prevents: Keeping OneDrive files in sync with the cloud. • Users from automatically uploading photos and videos from the camera roll folder. • Users from accessing OneDrive from the OneDrive app and file picker. • Windows Store apps from accessing OneDrive using the WinRT API. • OneDrive from appearing in the navigation pane in File Explorer. Setting "DisableFileSyncNGSC" group policy prevents OneDrive from working on both Windows 10 and 11. Windows 8 uses older "DisableFileSync" key...
Kill OneDrive process
It stops the execution of OneDrive. Main OneDrive process is "OneDrive.exe" and it is installed in "\\Microsoft\\OneDrive\\OneDrive.exe".
Remove OneDrive folder from File Explorer
File Explorer shows OneDrive to allow you to access files stored in OneDrive (stored online and locally cached). CLSID for OneDrive is "018D5C66-4533-4307-9B53-224DE2ED1FE6" for both Windows 10 and 11. Changing pinning option for this key removed OneDrive from navigation file in File Explorer. This CLSID includes "System.IsPinnedToNameSpaceTree" as value as "1" after clean installation in both Windows 10 and Windows 11.
Remove OneDrive from startup
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". It is found on both Windows 10 (since 21H2, missing in 20H2) and Windows 11 (since 23H2). The startup command is ""\\Microsoft\\OneDrive\\OneDrive.exe" /background".
Remove OneDrive installation files and cache
This script removes OneDrive installation directories, application data, temporary files, and cache. Identified by the community and confirmed through testing, these folders include: "C:\\OneDriveTemp": A location for temporary cache files. • "C:\\ProgramData\\Microsoft OneDrive": Stores data used in setting up OneDrive. • "C:\\Users\\\\AppData\\Local\\Microsoft\\OneDrive": OneDrive installation directory. | Directory | Windows 11 (since 22H2) | Windows 10 (since 22H2) | | --------- |:---------...
Remove OneDrive shortcuts
This script ensures the removal of all OneDrive shortcuts from your system, even after uninstallation or cleanup. Erasing these shortcuts improves the security and privacy of your computer system, lessening the potential access points for unwanted entities. Moreover, the removal of unused shortcuts results in a more organized and efficient system, enhancing your user experience by preventing any confusion from dead shortcuts. Shortcuts that link to OneDrive are stored in various locations, such ...
Remove OneDrive through official installer
This script will call official Microsoft uninstaller that will uninstall the application but residual files will be left. You won't lose data by uninstalling OneDrive from computer because they will be stored in cloud. Running OneDrive client setup package ("OneDriveSetup.exe") with the "/uninstall" command line switch uninstalls OneDrive. On Windows 10, the setup package is found on different folders ("System32" or "SysWOW64") based on the CPU architecture. On Windows 11, the setup package is a...
Remove OneDrive user data and synced folders
This script deletes the OneDrive directory and all stored data from your profile. OneDrive usually saves your data in the "%USERPROFILE%\\OneDrive" directory, also known as the OneDrive folder or OneDrive root directory. By default, OneDrive stores user data in folder called OneDrive. For multiple accounts, files may be in OneDrive - Personal or OneDrive - CompanyName folders. OneDrive can synchronize default Windows folders like Documents, Pictures, Music, and Desktop. These fo...