OneDrive File Issues

How to Automate the OneDrive.exe /reset Command for Windows Users

Kushani NimanthikaKushani Nimanthika Oct 20, 2026 868 views

Question details

The user needs to automate the execution of the OneDrive reset command for users experiencing synchronization failures, specifically addressing the issue where system-level scripts fail to correctly resolve the user's %localappdata% path.

How to Automate the OneDrive.exe /reset Command for Windows Users
Product
OneDrive
Device & OS
Windows
Scenario
Deploying an automated script to reset the OneDrive application across multiple user profiles in an enterprise or networked environment.
Observed behavior
System-level automation scripts fail to correctly identify the %localappdata% variable because OneDrive is installed in individual user directories, necessitating a user-context deployment method.
Before you start

Before deploying automation scripts, ensure you have administrative access to your network deployment tools (such as Group Policy or SCCM) and verify that users' unsynced local files are safely backed up.

Solution 1Recommended

Deploy a User-Context Script using Group Policy

Run a batch or PowerShell script within the user context so the %localappdata% path resolves to the actual user's profile rather than the system profile.

Because OneDrive resides in the user's local AppData folder, resetting it via system-level scripts will not work. You must trigger the reset command as the currently logged-on user.

1
Create the script file

Open a plain text editor like Notepad and type the reset command: %localappdata%\Microsoft\OneDrive\onedrive.exe /reset

2
Save the script

Save the document as a batch file (e.g., ResetOneDrive.bat) or a PowerShell script (e.g., ResetOneDrive.ps1) in a shared network location accessible to all users.

3
Open Group Policy Management

Launch the Group Policy Management Console (GPMC.msc) and create a new Group Policy Object (GPO) linked to the appropriate organizational unit.

4
Configure User Configuration

Navigate to User Configuration > Policies > Windows Settings > Scripts (Logon/Logoff) and add your created script to run at Logon.

Deploy a User-Context Script using Group Policy
Script Execution: Ensure that your environment's PowerShell Execution Policies allow the running of deployed scripts, and test the GPO on a small group of users first.
Free Microsoft Office alternative

Looking for a reliable Office suite with built-in cloud sync?

If you frequently encounter synchronization or deployment issues with Microsoft OneDrive, consider trying WPS Office. It provides a lightweight, seamless document editing experience with its own reliable built-in cloud storage and high compatibility with all major document formats.

100% compatible with Microsoft Office formats (.docx, .xlsx, .pptx)Built-in reliable WPS Cloud storage for automatic and easy synchronizationLightweight application that requires minimal system resourcesFree to use with a familiar, easy-to-navigate interface
microsoft office alternative - wps office

Frequently Asked Questions

Why does %localappdata% fail in system-level OneDrive reset scripts?

When a script runs at the system level (such as via a system account in SCCM or RMM tools), the %localappdata% environment variable resolves to the system profile's AppData folder instead of the currently logged-in user's folder. Since OneDrive is installed per user, the system cannot find the executable.

What is the standard command to reset OneDrive manually?

To reset OneDrive manually, you can open the Run dialog (Windows Key + R) and enter the following command: %localappdata%\Microsoft\OneDrive\onedrive.exe /reset. This will restart the sync engine.

Will running the OneDrive reset command delete my local files?

No, running the reset command does not delete your files. It only resets the application settings and forces a full re-sync of your data to ensure everything is properly aligned between the cloud and your local machine.