As part of some TFS related posts, I wrote about Find an installed tf.exe, then run it with the command-line parameters specified.
Below are some more batch files related to this. In each batch file, you can replace tf
with call "%~dp0tf.bat"
so the above batch file is executed first.