Windows – What command line can I use to start sync of Windows 7/10 offline files

command lineoffline-filessyncwindows 10windows 7

On Windows, I would like to start sync of offline files from the command line and after the fact be able to see in Sync Center when it either started or completed (and the result).

mobsync.exe does not offer command line help.

Is there some way from the command line to perform the same action as clicking on either:

  • the Sync button in Sync Center
  • the Sync button in Mobility Center

Best Answer

Here is a procedure for starting the synchronization (tested on MS Windows 10 v. 1903) with a command:

(1) Start mobsync.exe and click the Schedule action which starts the Offline Files Sync Schedule wizard where you can create a new sync schedule which will run just once or repeatedly.

enter image description here

(2) After you save the schedule under a name, e.g. "My Offline Files Sync", a new task gets created in Windows Task Scheduler at the following location:

\Microsoft\Windows\SyncCenter\ your user SID \ task id

(3) Find that task in the Task Scheduler and from the General tab copy the task name and the task ID, i.e. the last part of the task location including the curly brackets { and }.

(4) Now you can start the synchronization with the following command:

mobsync.exe /Schedule="task name","task id"

e.g.

mobsync.exe /Schedule="My Offline Files Sync","{750FDF10-2A26-11D1-A3EA-080036587F03}"

In order to run the command in PowerShell you can use the following syntax:

& mobsync.exe --% /Schedule="My Offline Files Sync","{750FDF10-2A26-11D1-A3EA-080036587F03}"