using tf to list the workspaces for the current directory in Team Foundation System
Posted by jpluimers on 2014/05/28
Since Visual Studio is always in a 32-bit directory, I needed the SetProgramFilesX86 batch file from
Windows batch file to set ProgramFilesX86 directory for 32-bit program files on x86 and x64 systems.
Here is a small batch file to list workspaces by any user for the current directory (assuming that directory is mapped to a workspace):
[sourcecode language=”text”]
call "%~dp0SetProgramFilesX86.bat"
:: assume Visual Studio 2005:
::"%ProgramFilesX86%\Microsoft Visual Studio 8\Common7\IDE\tf" workspaces /owner:* /computer:*
:: assume Visual Studio 2010:
"%ProgramFilesX86%\Microsoft Visual Studio 10.0\Common7\IDE\tf" workspaces /owner:* /computer:*
[/sourcecode]
It uses TF, and assumes default locations for various Visual Studio versions based on the internal version number.
A generic TF batch file that finds the TF is this one:
[sourcecode language=”text”]
call "%~dp0SetProgramFilesX86.bat"
:: assume Visual Studio 2005:
::"%ProgramFilesX86%\Microsoft Visual Studio 8\Common7\IDE\tf" %*
:: assume Visual Studio 2010:
"%ProgramFilesX86%\Microsoft Visual Studio 10.0\Common7\IDE\tf" %*
[/sourcecode]
–jeroen






Find an installed tf.exe, then run it with the command-line parameters specified. « The Wiert Corner – irregular stream of stuff said
[…] PS: This post supercedes using tf to list the workspaces for the current directory in Team Foundation System « The Wiert Cor…. […]