Share via


Developer Command Prompt for VS 2017 Giving Weird Errors.

Question

Tuesday, October 10, 2017 4:15 AM

When I open the Developer Command Prompt for Visual Studio 2017 I get these weird errors, how can I fix them?

https://imgur.com/a/GEfO3

All replies (10)

Tuesday, October 10, 2017 9:08 AM

Hi Tyler,

Thank you for posting in MSDN forum.

For the screenshot error message, there are two aspects caused this:

1. VS didn't install well, the VsDevCmd can't run properly.

2. Your computer environment variable setting is incorrect.

To determine the reason, please try steps below:

1. Navigate to path:

C:\Program Files (x86)\Microsoft Visual Studio\2017\**\Common7\Tools

(*** is your VS edition: Enterprise, professional or community).

2. Find VsDevCmd file and execute to see if it shows detailed error. if there is, please tell us the error info. Or you could follow the error to troubleshoot.

3. Run the VS installer to repair and update, reboot your machine.

4. Check windows update and install newest patches.

 5. Launch  Developer Command Prompt to see if it works fine.

Best Regards,

MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected].


Tuesday, October 10, 2017 11:53 PM | 1 vote

I get this error

PS C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools> .\VsDevCmd.bat
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.0.26730.16
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[ERROR:team_explorer.bat] Directory not found : "CommonExtensions\Microsoft\TeamFoundation\Team Explorer"
[ERROR:VsDevCmd.bat] *** VsDevCmd.bat encountered errors. Environment may be incomplete and/or incorrect. ***
PS C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools>

Also if I repair will I have to reinstall all my extensions and addins again?


Tuesday, October 17, 2017 2:12 AM

@Tylerjaacks,

According to the error log, it seems your Visual Studio installation folder "CommonExtensions\Microsoft\TeamFoundation\Team Explorer" is broken or missing, which causing the environment to fail to initialize. So you should repair or reinstall your Visual Studio, but you need to reinstall all you extensions and add ins again.

If this is not what you want, you can try to copy that folder from other machine, which have this folder. Then check if it works fine.

MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected].


Wednesday, October 18, 2017 5:10 AM

The folder does exist I checked.


Wednesday, October 18, 2017 7:55 AM

When you open the team_explorer.bat file, you will find below code:

@REM Add Team Explorer to PATH
set "__team_explorer_path=%DevEnvDir%CommonExtensions\Microsoft\TeamFoundation\Team Explorer"
if NOT EXIST "%__team_explorer_path%" (
    @echo [ERROR:%~nx0] Directory not found : "%__team_explorer_path%"
    goto :end
)

According to the error log "Directory not found : "CommonExtensions\Microsoft\TeamFoundation\Team Explorer"“. The actual directory should be "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer", so it seems the __team_explorer_path could not be set suessfully, please try to set this value into environment variable, then check if it works fine. If this still not help you, I think it is highly recommended to repair or reinstall your Visual Studio.

Hope this helps.

MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected].


Thursday, October 19, 2017 4:08 AM | 1 vote

I feel like this variable "%DevEnvDir%" isn't be set. Because that directory does exist.


Thursday, October 19, 2017 6:01 AM

It seems the reason for this issue. How about set value of this variable into environment variable?

MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected].


Thursday, October 19, 2017 5:28 PM

What does this value need to be set to?


Friday, October 20, 2017 8:20 AM

Hi Tyler,

Please check Leo Liu's penultimate step to set the value: 

  • On the Start menu, right-click My Computer (or Computer) and click Properties.

  • Click Advanced system settings.

    The System Properties dialog box appears.

  • Click the Advanced tab and then click Environment Variables.

  • In the System variables list, click Path and then click Edit.

    The Edit System Variable dialog box appears.

  • In Variable value, append a semicolon to the end of the path, followed by the path of the folder that contains the command-line client, and then click OK three times.

Best Regards,

MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected].


Tuesday, November 27, 2018 1:11 PM

If anyone else has this issue, in my case the problem was that I had a "VSINSTALLDIR" environment variable defined globally. If that's your case, makes sure that it has a trailing '\. For instance: "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\