Basically, I'm wondering if it's possible to sync OneDrive with a batch file. See, I can sync it whenever I go to File Explorer, right click on "OneDrive" on the left, and click "Sync," but I'm wondering if there's command windows has incorporated to have this exact same effect when used with a batch file. I have no idea what it is and have searched to no avail, so I hope that you can help me! Whatever it takes, I'm sure it would be an extremely simple script; the problem is finding out what command to use. Here's an example as a picture:

To shutdown OneDrive from the command line or in a batch file:
%LOCALAPPDATA%\Microsoft\OneDrive\OneDrive.exe /shutdown
To start OneDrive from the command line:
%LOCALAPPDATA%\Microsoft\OneDrive\OneDrive.exe /background
If the /background switch is omitted then Explorer is opened to the OneDrive folder in your user profile but OneDrive does not start.
If restarting OneDrive from a batch file then add the START command or the batch file won't end:
start %LOCALAPPDATA%\Microsoft\OneDrive\OneDrive.exe /background
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With