Is there a command to switch the active workspace from tf.exe ?
I have searched here and here.
But I do recall, I've seen it some time ago.
Asked
Active
Viewed 4,027 times
2

igorc
- 2,024
- 2
- 17
- 29
-
What's the detail mean of switching the active workspace? Did you mean you want to achieve the function same as changing workspace in Visual Studio from the arrow or just want to modify/update the workspace mapping? – PatrickLu-MSFT Jan 31 '18 at 12:20
1 Answers
2
If you just want to change a workspace, you could not be able to do this through tf.exe
command line. You should active you workspace window in Visual Studio:
- In Visual Studio,click Source Control Explore.
- From the Workspace dropdown select "Workspaces..."
- The Workspace window appears
- Click the WorkSpace name in Workspace window
- From the popup list choose the Workspace name you want.
If you want to modify/update the workspace mapping, you could use tf workfold
command, sample as below:
c:\projects>tf workfold /collection:http://servername:8080/tfs/collectionname /workspace:workspacename $/projects/project_one C:\DifferentWorkfold
The above example maps the folder C:\DifferentWorkfold
to the Team Foundation version control server folder $/projects/project_one
and replaces the previous workspace mapping for the $/projects/project_one
Team Foundation version control server folder.

PatrickLu-MSFT
- 49,478
- 5
- 35
- 62
-
Thanks, just wanted to change the workspace without opening the VS. Interesting why this wasn't implemented. – igorc Jan 31 '18 at 13:20
-
@jasondinAlt Sorry, not sure about this, however most of the `tf.exe` command support with `[/workspace:workspacename]` argument which could specifies the name of the workspace to work in. Seems like to be an option to switch workspace, however not be able to do the same thing as Visual Studio do from the Workspace dropdown in source control explore. – PatrickLu-MSFT Jan 31 '18 at 13:34