Command line and scripts
CloudMount for Windows comes with a cloudmount command for scripts,
scheduled tasks and shortcuts. It can read the status, pause and resume
syncing, check a drive for changes, free up space and run a sync task.
It works in Command Prompt, PowerShell and Windows Terminal once
CloudMount is installed, without changing PATH. CloudMount must be
running: it keeps running in the background after you close its window.
cloudmount statuscloudmount pause --for 2hcloudmount resumeCommands
Section titled “Commands”| Command | Does |
|---|---|
cloudmount status |
Shows whether syncing is paused, and each drive in File Explorer with its state, what’s waiting to sync and any problem |
cloudmount pause |
Pauses syncing on every drive until you resume it |
cloudmount pause --for 2h |
Pauses syncing for a while: 30m, 2h, 1h30m |
cloudmount pause --until 2026-10-26T18:00 |
Pauses syncing until a time, on this PC’s clock, or with an offset such as +01:00 |
cloudmount resume |
Resumes syncing |
cloudmount refresh Photos |
Checks a drive for changes made elsewhere now |
cloudmount refresh Photos "2026\Trip" |
Checks one folder of a drive, named as in File Explorer |
cloudmount free-up Photos |
Frees up space: removes the downloaded copies of files that are in sync and not set to always stay on this device |
cloudmount tasks |
Lists your sync tasks and folder backups, with their ids |
cloudmount run Documents |
Runs a sync task or folder backup now, by its name or id |
cloudmount run Documents --wait |
Runs it and waits until it ends |
cloudmount help |
Lists the commands |
Drive and task names can be in any case. If two tasks have the same name,
use the id from cloudmount tasks.
While syncing is paused, Explorer still opens your files; what you change
waits to upload. A paused sync task runs once syncing resumes, so
run --wait waits through a pause too.
In scripts
Section titled “In scripts”Add --json to any command to get its result as JSON, which stays the
same from version to version. The text output is meant for people and
may change.
$status = cloudmount status --json | ConvertFrom-Jsonif ($status.paused) { "Paused until $($status.pausedUntil)" }$status.drives | Where-Object state -ne 'online' | ForEach-Object { "$($_.name): $($_.state)" }status --json gives running, configLocked, paused, pausedUntil
(when the pause has an end), held (why syncing waits even though you
didn’t pause it, such as metered or batterySaver) and drives, each
with name, folder, state, pending, conflicts, and problem and
error when there’s a problem. A drive’s state is online, offline,
starting, locked, error or stopped.
Every command exits with a code a script can check:
| Exit code | Means |
|---|---|
| 0 | Done |
| 1 | It failed, or the sync task’s run didn’t succeed. The error says why. |
| 2 | The command was mistyped |
| 3 | CloudMount isn’t running |
| 4 | There’s no drive or task with that name |
For example, a scheduled task that backs up a folder and tells you when it fails:
cloudmount run "Documents" --waitif ($LASTEXITCODE -ne 0) { Write-Warning "The backup didn't finish." }Turning it off
Section titled “Turning it off”The command is an app execution alias. To turn it off, open Settings →
Apps → Advanced app settings → App execution aliases and turn off
CloudMount’s cloudmount.exe.
Any program you run can use the command, as it can use your files; other users on the PC can’t control your CloudMount.