System command

call command

Call another batch file or a label and return to the current script.

Availability: Microsoft Learn command reference spanning Windows client and Windows Server releases; some entries are legacy, role-specific, optional-feature or interactive subcommands.中文

Documented syntax

call [drive:][path]<filename> [<batchparameters>]]
call [:<label> [<arguments>]]

The linked Microsoft Learn article is the upstream authority. Availability may depend on Windows release, role, optional feature or interactive tool context.

Examples

Example usage for call.

call :write_log Build completed

Parameters, options and clauses

Option / clauseDescription
:<label>Call a label in the current batch file and return after it completes.
<batch-file>Call another batch file and return to the current script.
<arguments>Pass arguments to the label or batch file.
[<drive>:][<path>]<filename>Microsoft documents this argument or subcommand; check the linked reference for its required format and context.
<batchparameters>Microsoft documents this argument or subcommand; check the linked reference for its required format and context.
/?Display command help or the supported command-line usage.
<filename>Microsoft documents this argument or subcommand; check the linked reference for its required format and context.
Safety note

Review a command and its target before running it. Commands that alter files, services, accounts, disks, permissions or databases may be difficult to reverse. Test in a safe environment and keep backups.

Official reference ↗Back to directory