Command-line usage

The BitComet desktop application can create tasks and perform common actions from the command line. The examples use BitComet.exe on Windows; on Linux and macOS, replace it with the actual executable path. Options are case-sensitive. Run BitComet.exe --help to see the options supported by your installed version. New options require a version that includes them.

BitComet.exe --url "URL" [--silent] [--paused] [--tray]

--url accepts HTTP, HTTPS, FTP, Magnet URIs, and BC links. Quote URLs containing shell metacharacters such as & or spaces according to the shell you use.

HTTP headers and mirrors

These optional parameters require an HTTP/HTTPS primary download URL; they cannot be combined with FTP, Magnet, or BC links:

OptionPurpose
--cookieCookie value without the Cookie: prefix.
--refererReferring page URL without the Referer: prefix.
--user_agentUser-Agent value without the User-Agent: prefix.
--mirrorHTTP/HTTPS mirror URL for the same file. Use --mirror once per address; the option may be repeated.

Values can be written as --cookie "value" or --cookie="value". Use the equals form when a value begins with -- so it is not mistaken for an option. Cookie, Referer, and User-Agent can be explicitly empty; a mirror URL cannot. Control characters are rejected, and both primary and mirror URLs need a host. These options cannot be combined with other actions such as --exit, --file, or --make.

Sending custom HTTP headers to mirrors follows the task's Send custom HTTP headers to mirrors setting; adding --mirror does not enable it. By default, do not assume a mirror receives the original server's Cookie or User-Agent.

Windows: CMD

BitComet.exe --url "https://example.com/file.zip?a=1&b=2" --cookie "sid=\"abc123\"; token=a+b==" --referer "https://example.com/page?id=1&from=download" --user_agent "My Client/1.0" --mirror "https://mirror1.example.com/file.zip" --mirror "https://mirror2.example.com/file.zip" --silent

The Cookie received by the program is sid="abc123"; token=a+b==. In Windows arguments, backslashes have special meaning immediately before a double quote: \" represents a literal double quote. In a quoted value ending in backslashes, double the trailing backslashes before the closing quote, for example "D:\Download Folder\\".

CMD expands %VAR% even inside double quotes. In a .cmd or .bat file, write a literal % as %%. If a value contains !, disable delayed expansion, for example with setlocal DisableDelayedExpansion at the start of the batch file. Percent handling in interactive CMD and batch files differs.

Windows: PowerShell

PowerShell 7 can use the Standard native argument-passing mode:

$PSNativeCommandArgumentPassing = 'Standard'
& 'C:\Program Files\BitComet\BitComet.exe' --url 'https://example.com/file.zip?a=1&b=%2F' --cookie 'sid="abc123"; token=a+b==' --user_agent 'My Client/1.0' --mirror 'https://mirror.example.com/file.zip' --silent

Windows PowerShell 5.1 can pass an argument string quoted according to Windows rules via Start-Process:

Start-Process -FilePath 'C:\Program Files\BitComet\BitComet.exe' -ArgumentList '--url "https://example.com/file.zip" --cookie "sid=\"abc123\"; token=a+b==" --silent'

Single-quoted PowerShell strings prevent expansion of $ and backticks. Native argument handling differs between PowerShell versions and modes; do not assume that embedded double quotes are passed identically by 5.1 and 7.

Linux and macOS: Shell

bitcomet --url 'https://example.com/file.zip?a=1&b=%2F' --cookie 'sid="abc123"; token=a+b==' --referer 'https://example.com/page?a=1&b=2' --user_agent 'My Client/1.0' --mirror 'https://mirror.example.com/file.zip' --silent

Replace bitcomet with the actual executable path. Inside shell single quotes, spaces, double quotes, backslashes, $, and backticks are literal. A value containing a single quote needs additional quoting according to your shell. The shell processes the command before BitComet receives it, so the program cannot recover characters the shell has already expanded.

Cookies and other command-line arguments may be visible to other users or processes on the same computer and may remain in shell history. Do not put real cookies in shared scripts, logs, or examples.

Open or make a torrent

BitComet.exe "TORRENT_FILE" [--output "DIRECTORY"] [--silent] [--paused]
BitComet.exe --make "SOURCE" [--output "DIRECTORY"] [--piece_size "SIZE"] [--silent]

The first command opens an existing torrent; --output can specify the download directory. The second makes a torrent from a file or directory; --output can specify the directory for the resulting torrent file, and --piece_size can specify a piece size such as 256KB. --make, --output, and --silent also have the short forms -m, -o, and -s. If no output is specified, the corresponding task-creation flow chooses its default location.

Other actions

Unambiguous prefixes of long options are accepted, but full names are recommended to avoid ambiguity if options are added later. Windows also accepts long options beginning with /, such as /cookie; use -- on Linux and macOS.