TFS command line (tf.exe)

Now and then in my life as a lead developer/architect, I have to cope with TFS the ‘hard’ way: the user interface is not always as complete as one would want it to be. One of the greatest tools Microsoft has delivered us is tf.exe, a command line tool to do almost everything impossible with the user interface. However, tf.exe comes with one big draw-back. It does not offer a complete help. Just minutes ago I discovered the documentation I need at one Microsoft guy’s (Noah Coad’s) blog (
Just to be sure the help will never disappear, I printed the entire help file below, as well as did I include the help documents as text files.
I hope this helps you too.
tfhelp.txt (120 characters)
tfhelp.txt (80 characters)


Add        tf add itemspec [lock:none|checkin|checkout] [/type:filetype]

              [/noprompt] [/recursive]

Branch     tf branch olditem newitem [/version:versionspec] [/noget] [/lock]

              [/noprompt] [/recursive]

Branches   tf branches [/s:servername] itemspec

Changeset  tf changeset [/comment:comment|@commentfile] /s:servername

              [/notes:("NoteFieldName"="NoteFieldValue"|@notefile)] [/noprompt]


Checkin    tf checkin [/author:authorname] [/comment:("comment"|@commentfile)]


              [/notes:("Note Name"="note text"|@notefile)]

              [/override:reason|@reason] [/recursive] filespec …]

Checkout   tf checkout|edit [/lock:(none|checkin|checkout)] [/recursive]

              [/type:encoding] itemspec

Configure  tf configure pathtoproject /server:servername

Delete     tf delete [/lock:(none|checkin|checkout)] [/recursive] itemspec

Difference tf difference itemspec [/version:versionspec] [/type:filetype]

              [/format:(visual|unix|ss)] [/ignorespace]

              [/ignoreeol] [/ignorecase] [/recursive] [/options:"options"]

           tf difference itemspec itemspec2 [/type:filetype]

              [/format:(visual|unix|ss)] [/ignorespace] [/ignoreeol]

              [/ignorecase] [/recursive] [/options:"options"]

           tf difference [/shelveset:[shelvesetowner;]shelvesetname]

              shelveset_itemspec [/server:serverURL]

              [/type:filetype] [/format:(visual|unix|ss)] [/ignorespace]

              [/ignoreeol] [/ignorecase] [/recursive] [/options:"options"]

           tf difference /configure

Dir        tf dir [/s:servername] itemspec [/version:versionspec] [/recursive]

              [/folders] [/deleted]

Get        tf get itemspec [/version:versionspec] [/all] [/overwrite] [/force]

              [/preview] [/recursive] [/noprompt]

Help       tf help commandname

History    tf history [/s:servername] itemspec [/version:versionspec]

              [/stopafter:number] [/recursive]

              [/user:username] [/format:(brief|detailed)] [/slotmode]

Label      tf label [/s:servername]  labelname@scope [/owner:ownername]

              itemspec [/version:versionspec]

              [/comment:("comment"|@commentfile)] [/child:(replace|merge)]


           tf label [/s:servername] [/delete] labelname@scope

              [/owner:ownername] itemspec [/version:versionspec]


Labels     tf labels [/owner:ownername] [/format:(brief|detailed)]

              [/s:servername] [labelname]

Lock       tf lock itemspec /lock:(none|checkout|checkin)

              [/workspace:workspacename] [/server:serverURL] [/recursive]


Merge      tf merge  [/recursive] [/force] [/candidate] [/discard]


              [/lock:none|checkin|checkout] [/preview] [/baseless] [/nosummary]

              source destination

Merges     tf merges [/s:servername] destination [/recursive]

Permission tf permission [/allow:(* |perm1[,perm2,…]]


              [/remove:(* |perm1[,perm2,...])]

              [/inherit:yes|no] [/user:username1[,username2,…]] [/recursive]


              [/server:servername] itemspec

Properties tf properties [/recursive] itemspec

Rename     tf rename [/lock:(none|checkout|checkin)] olditem newitem

Resolve    tf resolve itemspec [auto:(AcceptMerge|AcceptTheirs|AcceptYours)]


              [(/overridetype:overridetype | /converttotype:converttype)]


Shelve     tf shelve [/move] [/replace] [/comment:(@commentfile|"comment")]

              [/recursive] shelvesetname[;owner] filespec

           tf shelve /delete [/server:serverURL] shelvesetname[;owner]

Shelvesets tf shelvesets [/owner:ownername] [/format:(brief|detailed)]

              [/server:serverURL] shelvesetname

Status     tf status itemspec [/s:servername]

              ([/workspace:workspacename[;workspaceowner]] |


              [/format:(brief|detailed)] [/recursive] [/user:(*|username)]

Undelete   tf undelete [/noget] [/lock:(none|checkin|checkout)]

              [/newname:name] [/recursive] itemspec[;deletionID]

Undo       tf undo [/workspace:workspacename   [;workspaceowner]]

              [/s:servername] [/recursive] itemspec

Unlabel    tf unlabel [/s:servername] [/recursive] labelname itemspec

Unshelve   tf unshelve [/move] [shelvesetname[;username]] itemspec

View       tf view [/s:servername] [/console] [/noprompt] itemspec


WorkFold   tf workfold localfolder

           tf workfold [/workspace: workspacename]

           tf workfold [/s:servername] [/workspace: workspacename]


           tf workfold [/map] [/s:servername] [/workspace: workspacename]


           tf workfold /unmap [/s:servername] [/workspace: workspacename]

              [/recursive] (repositoryfolder|localfolder)

           tf workfold /cloak (repositoryfolder|localfolder)

              [/workspace: workspacename] [/s:servername]

           tf workfold /decloak (repositoryfolder|localfolder)

              [/workspace:workspacename] [/s:servername]

Workspace  tf workspace /new [/noprompt]


              [/computer:computername] [/comment:("comment"|@commentfile)]


           tf workspace /delete [/s:servername]


           tf workspace [/s:servername] [/comment:comment]

              [/newname:workspacename] workspacename[;workspaceowner]

Workspaces tf workspaces [/owner:ownername] [/computer:computername]

              [/s:servername] [/format:(brief|detailed)]


              [/updateComputerName:oldcomputername] workspacename



  Can contain wildcards *, ? and #

  Can contain relative path parts . and ..

  Can reference file system or UNC paths mapped to a workspace or server

  paths (which start with $/). You can usually specify more than one

  file separated by spaces for an itemspec (useful for edit, add, delete




  Date/Time         Dmm/dd/yyyy

  Changeset number  Cnnnnnn

  Label             Llabelname

  Latest version    T

  Workspace         Wworkspacename;workspaceowner



  /changeset  /G     /noprompt   /I

  /comment    /C     /owner      /O

  /computer   /M     /recursive  /R

  /delete     /D     /server     /S

  /force      /P     /slotmode   /X

  /format     /F     /template   /T

  /help       /?,/H  /user       /U

  /lock       /K     /version    /V

  /login      /Y     /workplace  /W

  /newname    /N    

13 thoughts on “TFS command line (tf.exe)

  1. iopaul

    You can show the files asociated with a change set using this:
    tf changeset ChangeSet# /noprompt
    e.g. tf changeset 3516 /noprompt

  2. Bert Loedeman Post author

    Hi, since I didn’t need that so far, I would have to try and error just like you on this one. I therefore suggest you try using my list and keep me posted on the results ;) !

  3. Rajendra

    I am getting output file but it display folder name in one line and the only file names (No full path) containing that folder in folling lines


  4. Rajendra

    I am using TF dir command. I want output of command in txt file with full path name.
    How to do that?
    Thanks in advance.

  5. Bert Loedeman Post author

    Hi Nick!

    Thanks for reading my blog. Also, thanks a lot for this addition to my blog post!

    Cheers, Bert

  6. Nick Hoffman

    Those commands can be obtained with the /? option:

    C:\Users\nickh>tf /?
    TF – Team Foundation Version Control Tool
    Copyright (c) Microsoft Corporation. All rights reserved.

    Type tf help for command line description.
    Type tf msdn for full documentation in Microsoft Document

    tf add Adds new files and folders from a local file system location
    to Team Foundation version control.

  7. KonstantinMiller

    How soon will you update your blog? I’m interested in reading some more information on this issue.

  8. CrisBetewsky

    I’m glad that after surfing the web for uch a long time I have found out this information. I’m really lucky.

Comments are closed.