I use WinXP, VS 2008 and Team Explorer to connect to Team Foundation Server.
I need to script (e.g. BAT file script) the following:
- Get latest version of folder in Team Project.
- Check out files of folder in Team Project.
- Check in files of folder in Team Project.
My TFSProject is $/Arquitectura/Main/
, mapped to the path C:\TFS\Arquitectura
Does anyone have any sample code or suggestions?
Use tf.exe in the command line.
In the following examples, the
%PathToIde%
is usually on a path like this:%ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE
, or on Windows x64:%ProgramFiles(x86)%\Microsoft Visual Studio 10.0\Common7\IDE
(depending on Visual Studio version and installation settings).Example for get:
Example for checkout:
Example for checkin:
See for more information on the tf commandline.
get up to date code for Windows 7 64bit
This worked for me.
"C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\tf.exe" get "$/ProjectName/Main" /force /recursive
Update for VS2017
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\tf.exe'