views:

121

answers:

1

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?

+4  A: 

use the tf command line

Example for get:
cd C:\TFS\Arquitectura
%ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE\TF.exe get $/Arquitectura/Main /recursive

Example for checkout:
cd C:\TFS\Arquitectura
%ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE\TF.exe checkout $/Arquitectura/Main /recursive

Example for checkin:
cd C:\TFS\Arquitectura
%ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE\TF.exe checkin $/Arquitectura/Main /recursive

See for more information on the tf commandline: http://msdn.microsoft.com/en-us/library/z51z7zy0(v=VS.90).aspx

Ewald Hofman