JG Vimalan's Blog

It is all about coding!

Get latest sources from tfs using .bat file

I used to get latest sources from tfs several times a day. Also, I depend on multiple projects in tfs.  So, I created a simple .bat file to get the latest sources from multiple projects in tfs by a single click. Here is the code,
ECHO STARTING. PLEASE WAIT….

CD C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC
CALL vcvarsall.bat x86
tf.exe GET ITEMSPEC /FORCE /ALL /OVERWRITE /RECURSIVE $/ProjectA
tf.exe GET ITEMSPEC /FORCE /ALL /OVERWRITE /RECURSIVE $/ProjectB
tf.exe GET ITEMSPEC /FORCE /ALL /OVERWRITE /RECURSIVE $/ProjectC/Binaries
tf.exe GET ITEMSPEC /FORCE /ALL /OVERWRITE /RECURSIVE $/ProjectD
ECHO **************************                       
ECHO       COMPLETED 
ECHO  YOUR CHECKED OUT FILES
ECHO          ARE           
ECHO    NOT OVERWRITTEN  
ECHO **************************

PAUSE

Copy the above lines of code, create a file with .bat extension and paste in it. Simple things makes your life easier.

Advertisements

September 30, 2010 - Posted by | TFS

5 Comments »

  1. How can I compile the latest sources using .bat file?

    Comment by Yuvraj | February 25, 2011 | Reply

    • Use msbuild to compile latest sources using.bat file

      Comment by yogesh | October 17, 2012 | Reply

  2. yaar want to access through user name & password…. b’coz not in domain… getting message not authorized to aceess

    Comment by nitesh | July 24, 2013 | Reply

  3. thanks for quick reply… but i am trying to get latest source code .. but getting An authorized user…
    sample code:
    CD C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC
    CALL vcvarsall.bat x86
    tf.exe GET ITEMSPEC /FORCE /ALL /OVERWRITE /RECURSIVE $/nites/project

    please help…

    Comment by nitesh | July 24, 2013 | Reply


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: