# Pass Variables to External Tools

You can specify that certain information is passed to a command when it is launched, such as command line switches for console applications.

Fill in the Arguments box with the necessary launch arguments, either manually or using the auto-fill button.

The auto-fill argument button can provide you with the macros described in the table below.

Table 1. External Tools Macros

Name

Argument

Description

Item Path

$(ItemPath) The complete filename of the current source (defined as drive + path + filename); blank if a non-source window is active. Item Directory $(ItemDir)

The directory of the current source (defined as drive + path); blank if a non-source window is active.

Item File Name

$(ItemFilename) The filename of the current source (defined as filename); blank if a non-source window is active. Item Extension $(ItemExt)

The filename extension of the current source.

Current Line

$(CurLine) The current line position of the cursor in the editor. Current Column $(CurCol)

The current column position of the cursor in the editor.

Current Text

$(CurText) The selected text. Target Path $(TargetPath)

The complete filename of the item to be built, (defined as drive + path + filename).

Target Directory

$(TargetDir) The directory of the item to be built. Target Name $(TargetName)

The filename of the item to be built.

Target Extension

$(TargetExt) The filename extension of the item to be built. Binary Directory $(BinDir)

The final location of the binary that is being built (defined as drive + path).

Project Directory

$(ProjectDir) The directory of the current project (defined as drive + path). Project filename $(ProjectFileName)

The filename of the current project (defined as drive + path + filename).

Solution Directory

$(SolutionDir) The directory of the current solution (defined as drive + path). Solution filename $(SolutionFileName)

The filename of the current solution (defined as drive + path + filename).