TechLifeWeb

Exploring the digital life

How to reset OneDrive and clear Office Cache


Published by 
 on 

Be sure OneDrive is set to use Office Applications by going to OneDrive settings, Office tab and be sure "Use Office applications to sync Office files that I open" is checked Be sure all Office applications are **closed**

Copy the text below and save it as a batch file onedrivefix.bat:

@echo off
echo Clearing caches...
For /R "%localappdata%\Microsoft\Office\16.0\OfficeFileCache" %%i IN (*.*) do (
del "%%i"
)
%localappdata%\Microsoft\OneDrive\onedrive.exe /reset
timeout 3
start %localappdata%\Microsoft\OneDrive\onedrive.exe
echo onedrive has been reset
pause

Then run the batch file and OneDrive will reset.

It is possible that OneDrive.exe isn't in the folder above so if this doesn't start Onedrive, you might need to figure out where OneDrive.exe is. Most likely C:\Program Files\Microsoft OneDrive\onedrive.exe. Then you'll have to modify the script with the correct location.

Find the location of the onedrive
Search Start for OneDrive –> open file location.
right click onedrive shortcut –> open file location