user3231442
user3231442

Reputation: 620

How delete workspace every time

I write batch file. This script create new map to tfs, download some file from tfs, and delete tfs map and workspace. I first start this script:

cd c:\Publish\Test
tf workspace /new blah1 /noprompt /collection:http://servertfs:8080/tfs/DefaultCollection/    /login:SERVERTFS\Administrator,password
tf workfold /map $/ . /login:SERVERTFS\Administrator,password
tf get "$/Somepath" /force /recursive 
tf workspace /delete /noprompt blah1

In next step I start script but with different name workspace:

cd c:\Publish\Test
tf workspace /new blah2 /noprompt /collection:http://servertfs:8080/tfs/DefaultCollection/ /login:SERVERTFS\Administrator,password
tf workfold /map $/ . /login:SERVERTFS\Administrator,password
tf get "$/Somepath" /force /recursive 
tf workspace /delete /noprompt blah2

And after this I see error:

The working folder c:\Publish\Test is already in use by the workspace blah1;Administrator on computer SERVERTFS

It's possible delete working directory on each script? How it's fix?

Upvotes: 1

Views: 634

Answers (1)

Larcend
Larcend

Reputation: 66

You need to use

tf workspace /delete     # Remove a workspace
tf workspaces /remove    # Clear your client cache

to completely remove your workspaces.

Upvotes: 1

Related Questions