Running Tasks from the Command Line

You can start and reset SyncFolder tasks from a command prompt, a PowerShell script, a batch file or the Windows Task Scheduler. Use the command SyncFolder.exe (which Windows makes available as an app execution alias when SyncFolder is installed) or %LOCALAPPDATA%\Microsoft\WindowsApps\SyncFolder.exe.

Finding the Task ID

Each command needs the ID of the task. It is shown below the task name on the Task configuration page and on the Status page. Click Copy ID to clipboard to copy it.

Commands

CommandExampleDescription
--helpSyncFolder.exe --helpShow information about the meaning and usage of all supported command line parameters.
--execSyncFolder.exe --exec 16706171-e7a1-43c7-b327-167e8861d7b3Request the app to run the task with the given ID. You can specify multiple tasks by adding the IDs with a comma as the separator.
--exec … --minimizeSyncFolder.exe --exec 16706171-e7a1-43c7-b327-167e8861d7b3 --minimizeExecute the indicated task(s) without opening the app window: it runs the task(s) in the background and keeps running afterwards, ready for the next command or scheduled trigger.
--exec … --resetSyncFolder.exe --exec 16706171-e7a1-43c7-b327-167e8861d7b3 --reset --minimizeReset the indicated task(s) before executing them. A reset clears the task's cache files and puts it in a condition where it appears that the task has not been executed yet.
--resetSyncFolder.exe --reset 16706171-e7a1-43c7-b327-167e8861d7b3Reset the indicated task(s) without executing them.
--maxwaitstart /wait SyncFolder.exe --exec 16706171-e7a1-43c7-b327-167e8861d7b3 --minimize --maxwait 60Used together with start /wait, --exec and --minimize: change how many minutes the waiting command gives up after if it never hears back (default 15) — see Waiting for Completion.
Run two tasks in sequence
SyncFolder.exe --exec 16706171-e7a1-43c7-b327-167e8861d7b3,9f1c2d3e-4b5a-6789-0abc-def123456789
IDs separated by a comma, without spaces
Run minimized from a script
Start-Process SyncFolder.exe `
  -ArgumentList "--exec 16706171-e7a1-43c7-b327-167e8861d7b3 --minimize"
PowerShell

Waiting for Completion

SyncFolder is a permanently running app: it starts automatically at Windows sign-in and keeps running in the background even if you never open its window. Because of this, a command you start simply hands the request over to that already-running instance and returns immediately, even though the task(s) are still running. To make a script or batch file actually wait for the task(s) to finish, launch SyncFolder with start /wait and include --exec and --minimize as command parameter:

Wait for a task to finish
start /wait SyncFolder.exe --exec 16706171-e7a1-43c7-b327-167e8861d7b3 --minimize
Batch file / command prompt

/wait only works together with --minimize. Without it, SyncFolder opens its window to run the task(s) instead of running them in the background, and the waiting process will exit shortly after triggering execution.

By default, a waiting command gives up after 15 minutes if it never hears back. Add --maxwait <minutes> to change that, for example when a task is known to take longer:

Wait up to one hour
start /wait SyncFolder.exe --exec 16706171-e7a1-43c7-b327-167e8861d7b3 --minimize --maxwait 60
Batch file / command prompt

What You See

When SyncFolder is started with a command without --minimize, it opens a page with "The app has been invoked through a command line", the tasks to run, and their progress. If the task ID is unknown and eror Unknown task will be reported. The Status page of each task shows Command line as the execution type.

With --minimize, none of this is shown: the task(s) run in the background without opening the app window at all.

If one of the tasks is configured to shut down the computer afterwards, SyncFolder first asks for confirmation — see Pre- and Post-Run Actions.