77

I am using Team Services on domain visualstudio.com and I need to delete one project, I found out that I need to use command prompt to delete projects, but when I tried the script it seemed that it doesn't work

My Script is,

TfsDeleteProject 
  /force collection:https://mytfs.visualstudio.com/DefaultCollection MyProject

My first mistake was that I didn't append DefaultCollection to the URL, but now I get error that I don't have privileges.

Esther Fan - MSFT
  • 8,276
  • 4
  • 27
  • 25
zdarsky.peter
  • 6,188
  • 9
  • 39
  • 60
  • 1
    In general, if you've tried a script, and it doesn't work, then you should show us how you invoked the script, and you should show us the error messages (or other definition of "it doesn't work"). If the script is yours, then you should show us the script. If it's not yours, then you should show us where you got it from. – John Saunders Nov 30 '12 at 04:12
  • Try doing it from a command prompt and browsing into the directory your workspace is mapped to. I find some things (such as tf commands) don't work correctly if you're in a different directory. – Daniel Morritt Nov 30 '12 at 12:23

5 Answers5

137

Thanks to @Christopher I was able to make the script work.

You can use the following command from the "Developer Command Prompt":

TfsDeleteProject /collection:https://mytfs.visualstudio.com/DefaultCollection MyProject

Printscreen of command prompt with working script

DaveShaw
  • 52,123
  • 16
  • 112
  • 141
zdarsky.peter
  • 6,188
  • 9
  • 39
  • 60
  • 1
    Note that TfsDeleteProject exists in path of both "Visual Studio * Command Prompt *" (which does not work for this) and "Developer Command Prompt". At least with my installation I had to use the latter. – Tedd Hansen Feb 21 '13 at 09:04
  • 1
    `TfsDeleteProject.exe` is actually in `C:\Program Files\Microsoft Visual Studio 11.0\Common7\IDE>`. At least that is where it gets installed in my computer. – Rosdi Kasim Jun 21 '13 at 05:57
  • @JohnSaunders Worked for me on Windows 7 from the "Developer Command Prompt for VS2012". – BrainSlugs83 Sep 04 '13 at 15:48
  • And we were worried about the web page moving... it's the EXE that's going to move. :) – Christopher Painter Oct 29 '13 at 00:49
47

You can now do it via visualstudio.com

  1. Open the administration context for the team project collection by choosing the gear gear icon.

    admin

  2. Open the action menu menu for the team project that you want to delete.

    enter image description here

    If you don’t see the actions icon action menu, either you’re not accessing VSTS or you’re not a member of the Project Collection Administrators group.

  3. You must type the name of the team project in order to initiate the delete operation.

    delete project

shA.t
  • 16,580
  • 5
  • 54
  • 111
artfulhacker
  • 4,823
  • 1
  • 37
  • 31
  • 4
    What do I do if my delete button is greyed out. – Zapnologica Jan 24 '14 at 11:36
  • 1
    My delete button is also greyed out. Is there any steps I can take? – sleath Jul 22 '15 at 13:58
  • 1
    `Greyed out button` - I think it greys out depending where you are trying to delete from. You must be on the *collections admin page* not on the *project admin page*. So make sure you Click `control panel` (top left) and then click `View the collection admin page` NOT the `project admin` page. If you have an option to `set team as project default` then you're in the project admin screen and will have the disabled button. – benscabbia Oct 27 '15 at 18:33
  • 1
    Doesn't appear to exist anymore – johnstaveley Oct 04 '17 at 13:49
  • @johnstaveley just because you can't find it doesn't mean you should downvote the answer. It is clearly there under the same gear icon and click the "Overview" tab. The arrow icon has turned into 3 dots on hover and still has a delete option when clicked. – artfulhacker Oct 09 '17 at 17:27
  • Sorry, maybe I've misunderstood the point of downvoting. I downvoted because the answer was not correct. The administration tasks you say are there clearly aren't. Do you need me to send a screenshot? – johnstaveley Oct 10 '17 at 05:16
  • updated screenshots and steps to match new vso ui. if you still don't see the 3 dot action menu then you are not a project collection administrator. see this: https://learn.microsoft.com/en-us/vsts/security/set-project-collection-level-permissions – artfulhacker Oct 11 '17 at 20:46
8
  1. Open “Developer Command Prompt” under “Program Files>Microsoft Visual Studio” or in Windows 8 type “Developer“.

  2. In the command prompt, use this command template below to delete your project from TFS. Replace the YourTFSName to yours and also the ProjectName to the name of your project.

    TfsDeleteProject /collection:https://YourTFSName.visualstudio.com/DefaultCollection ProjectName
    
  3. Hit Enter and then Y if you are prompted for confirmation.

  4. Done. Double check by login to your TFS online.

From http://bizvise.com/2013/03/08/how-to-delete-team-project-from-my-team-foundation-service-tfs-default-collections/

shA.t
  • 16,580
  • 5
  • 54
  • 111
JeeShen Lee
  • 3,476
  • 5
  • 39
  • 59
2

Although the accepted answer is absolutely correct and very clear, I managed to get lost and run into that 'grayed out Delete button' issue and just wanted to share what I was doing wrong.

For the folks having issue with grayed out delete button, make sure that you are inside 'View the collection administration page' (as shown in the accepted answer), not inside the project itself.

If the last breadcrumb on the top of your VS Team Services is the name of the project, you are at the wrong place (it looks similar). Here the Delete button (appears on right clicking the project name) will be grayed out.enter image description here

If you click the link that says 'View the collection administration page' after clicking the Settings(gear), you will be at the right place.enter image description here

enter image description here

Esther Fan - MSFT
  • 8,276
  • 4
  • 27
  • 25
haku
  • 4,105
  • 7
  • 38
  • 63
0

if your project name have space, you must use "MyProject name" TfsDeleteProject /collection:https://mytfs.visualstudio.com/DefaultCollection "MyProject name"

Ohia
  • 1