Solved

Microsoft, Team Foundation Source Control, Command Line get command

Posted on 2007-11-14
2
951 Views
Last Modified: 2013-11-26
I need to have a batch file (or equivalent) which would retrieve a particular directory from my TFS to a specific location on my PC.

(A)
I tried to use the "get" command from the command line as below:
TF get $/myProject/Assets/UseCase /version:T /overwrite /recursive /noprompt

but got the error
Unable to determine the workspace.
(B)
I then tried
runas /noprofile /user:MYDOMAIN\user cmd

this prompted me for my password
I then entered the password and the cmd window was launched
I navigated to "D:\Program Files\Microsoft Visual Studio 8\Common7\IDE>" (Installed in D drive) and tried
TF get $/myProject/Assets/UseCase /version:T /overwrite /recursive /noprompt

but got the error
Unable to determine the workspace.

Regards
Koshy75
0
Comment
Question by:koshy75
2 Comments
 
LVL 30

Accepted Solution

by:
SteveGTR earned 300 total points
Comment Utility
I can't say specifically what the problem is, but a search on google finds a number of hits that might prove helpful:

http://www.google.com/search?q=%22Unable+to+determine+the+workspace%22+TF+get
0
 

Author Comment

by:koshy75
Comment Utility
I needed to have a batch file which would retrieve a particular directory from my TFS to a specific location on my PC.
One main point which I missed out was that the "tf get" option would work only if launched from the mapped directory (which SteveGTR pointed out to me)

This is what I eventually did:
=====================================================================
Team Explorer (TFS) installed on D drive.
The path of tf.exe: "D:\Program Files\Microsoft Visual Studio 8\Common7\IDE\tf.exe"

Source control folder: "$/myProject"
Specific section of source control sub-folder to be retreived by the batch file: "$/myProject/Assets/Flow Diagrams"

Mapped local folder: "C:\My Files"
Destination path: "C:\My Files\Assets\Flow Diagrams"

1. First navigate to the mapped local folder
      e.g. cd "c:\My Files\Assets\Flow Diagrams"
2. Execute tf.exe with the following options
      "D:\Program Files\Microsoft Visual Studio 8\Common7\IDE\tf.exe" get "$/myProject/Assets/Flow Diagrams" /all /recursive /noprompt

Note:
There are multiple other options for "tf get" which you could choose based on your requirements.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
This video discusses moving either the default database or any database to a new volume.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now