We recommend using Visual Studio 2017
This documentation is archived and is not being maintained.

How to: Create a Workspace from the Command-Line

Visual Studio 2008

You must have a local workspace before you can perform Team Foundation version control commands on your computer. The following procedures describe how to create a workspace from the command line. For more information, see Workspaces Command. You can also create workspaces from Team Foundation. For more information see How to: Create a Mapped Workspace. To see all the workspaces you created for your account, type tf workspaces from the tf command-line utility.

Required Permissions

To perform these procedures, you must have the permissions for Create a workspace or Administer workspaces set to Allow. For more information, see Team Foundation Server Permissions.

To create a local workspace to manage version-controlled files from the command line

  1. Click Start, click All Programs, point to Microsoft Visual Studio 2008, point to Visual Studio Tools, and then click Visual Studio Command Prompt.

  2. Type mkdir path, where path is the location of a directory where you want to store your personal copy of the files from the server (for example, c:\projects).

  3. Type cd path, where path is the directory that you just created.

  4. Type tf workspace /new /s:servername,where servername is the name of your Team Foundation Server (for example, team1server), and then press ENTER.

  5. In the Add Workspace dialog box, type a descriptive name in the Name box, enter a comment describing the new workspace in the Comment box, and provide alternative Owner and Computer values, as necessary.

  6. Under Working Folders, in the Source Control Folder column, click the text box, and then click the ellipsis ().

  7. In the Browse for Folder dialog box, select a server folder, and then click OK.

    If you want to map the Team Foundation Server folder and only its immediate child items to the local workspace, you can also add /* to the Source Control Folder box. The asterisk is a (*) wild card character.


    If you include an asterisk wild-card character, you only map one level under the folder. If you do not include an asterisk, you recursively map all children.

  8. In the Local Folder box, click the text box, and then click the ellipsis ().

  9. In the Browse for Folder dialog box, select a folder on your computer, and then click OK.

  10. Click OK to create the workspace.