Using the VSS Command Line

See Also

You can use the VSS command line to run batch files and macros. In addition, you can use the command line to perform all VSS Explorer commands.

Carrying Out Commands on the Command Line

You can start a command shell from Windows 95 or Windows NT and type VSS commands from there. To do this, the VSS folder must be on your path (set with the PATH environment variable).

You can also use the Run command on the Windows Start menu to run a specific command. For example, you can type ss Get *.* to get all files in the current project.

Command-Line Syntax

Command-line commands have the following general syntax:

ss command [one or more items] [one or more options]

What an item is depends on the command. For instance, for the Get command, an item is a VSS file or project; for the Add command, an item is an operating system file.

In almost all cases where you can specify an item to act on, you can specify more than one item. For instance, any of the following are valid ways of executing the Get command:

ss Get HELLO.C
ss Get HELLO.C HELLO.H TEST.H makefile
ss Get *.C *.H makefile linkfile
ss Get *.*

The command line is case-insensitive, that is, the command ss Get HELLO.C can also be typed as ss get Hello.c.

Note   You do not have to type an entire command name for the VSS command line to recognize it; you need only type enough of the name for VSS to be able to distinguish it from every other command. In most cases, typing the first two or three characters is sufficient.

Command-Line Options

In addition to the command and the items, you can specify options, or parameters. Options are preceded by a hyphen and modify the command. A few options are specific to a command, and are described in that command's command-line Help topic. There is also a set of general options applicable to many commands. They are described in the following table.

Option Description
-C Use one (or no) comment for all specified items. (The Dir command uses this option in a different way.)
-O Redirect or paginate the output of the command.
-V Operate on a specific version of an item.
-R Perform a command recursively.
-S Turn SmartMode on or off for the command.
-G Change the way the Get command works on any file retrieved to the local drive.
-W Indicate whether local copies are read-only.
-N Change between long and short file name mode.
-I- Ignore: Do not ask for input under any circumstances.
-Y Specify username and password.
-?, -H Request online Help with a command: The -H command-line option obtains the same result.

Use quotation marks around the entire parameter whenever an item or option contains the space character as part of a string of text. For example, use "-CThis is the comment" rather than -C"This is the comment". Otherwise, VSS treats the space as a separator between different parameters, and the command either fails or yields unexpected results.