Unable to determine the workspace

I am executing the below command line implementation as .bat file. I am getting "Unable to determine the workspace" while getting the latest version.


IF NOT EXIST C:\TFSGet MD C:\TFSGet
tf workspace /delete ws1 /noprompt /s:s1 /login:j,j1
tf workspace /new /s:s1 ws1 /noprompt /login:j,j1

tf workfold /s:s1 /workspace:ws1 /unmap $/
tf workfold /server:s1 /workspace:ws1 /map $/x/y/z/customer/9 C:\TFSGet

tf get /recursive /noprompt
echo getting files
echo finished

[526 byte] By [jayaseelan] at [2007-12-22]
# 1
where are you executing the bat file from? Are you on a drive other than C?
swaham at 2007-8-30 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Build Automation...
# 2

The 'get' command in tf.exe attempts to automatically determine the workspace which it should operate on. For this to work correctly there can only be one workspace with a local path mapped at or below the directory in which the get is performed. So you have two possible solutions to your problem:

1. Make sure there is only one workspace with a mapping anywhere on the C: drive

2. (The more appropriate solution) Have your script perform a 'cd c:\tfsget' before performing the get.

Let me know if this doesn't work out for you.

Patrick

PatrickCarnahan-MSFT at 2007-8-30 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Build Automation...
# 3

Yes, I am using more than one workspace in my system. The first one is default workspace and the another one i am creating through script.

OK... Please let me know solution for handling more that one workspace?

AJS

jayaseelan at 2007-8-30 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Build Automation...
# 4

Try:

IF NOT EXIST C:\TFSGet MD C:\TFSGet
tf workspace /delete ws1 /noprompt /s:s1 /login:j,j1
tf workspace /new /s:s1 ws1 /noprompt /login:j,j1

tf workfold /s:s1 /workspace:ws1 /unmap $/
tf workfold /server:s1 /workspace:ws1 /map $/x/y/z/customer/9 C:\TFSGet

pushd C:\TFSGet

tf get /recursive /noprompt
echo getting files
echo finished

This should do the trick.

-Aaron

AaronHallberg at 2007-8-30 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Build Automation...
# 5

Working fine....

Thanks

AJS

jayaseelan at 2007-8-30 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Build Automation...

Visual Studio Team System

Site Classified