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.
(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:
e.g.
In order to run the command in PowerShell you can use the following syntax: