Utility: Command line

VSTS | TFS 2018 | TFS 2017 | TFS 2015

Run a program from the command prompt.




Argument Description

Specify the tool you want to run.

If you are using an on-premises agent, in most cases you should configure the machine so that the tool is on the PATH enviornment variable. But if you know the location of the tool, you can specify a fully qualified path.

Arguments Specify arguments to pass to the tool.
Working folder Specify the working directory in which you want to run the command. If you leave it empty, the working directory is $(Build.SourcesDirectory).
Fail on standard error Select this check box if you want the build to fail if errors are written to the StandardError stream.
Control options


On the Build tab of a build definition, add these steps:

Utility: Command Line

Get the date.

  • Tool: date
  • Arguments: /t

Utility: Command Line

Display the operating system version.

  • Tool: ver

Utility: Command Line

Display the environment variables.

  • Tool: set

Utility: Command Line

Display all files in all the folders created by the build definition.

  • Tool: dir
  • Arguments: /s
  • Advanced, Working folder: $(Agent.BuildDirectory)


Where can I learn Windows commands?

An A-Z Index of the Windows CMD command line

Do I need an agent?

You need at least one agent to run your build or release. Get an agent.

I can't select a default agent queue and I can't queue my build or release. How do I fix this?

See Agent pools and queues.

I use TFS on-premises and I don't see some of these features. Why not?

Some of these features are available only on VSTS and not yet available on-premises. Some features are available on-premises if you have upgraded to the latest version of TFS.