Error Starting Developer Command Prompt for VS 2019

Duncan James 1 Reputation point
2021-04-28T14:46:29.367+00:00

Fresh install of 2019. Went to run any of the command prompt links...got the error..

"Files was not expected at this time".

This was due to a quoted string in the environment variable VS160COMNTOOLS.

There is an IF statement in the file vsdevcmd_start.bat that has the line

if "%VS160COMNTOOLS%" NEQ "" (

And this breaks with the quotes. I added this code to "delete the quotes" for the sake of this comparison ( and beyond )

`
goto do_test

:remove_quotes

set %1=%~2

goto :EOF

:do_test
call :remove_quotes VS160COMNTOOLS %VS160COMNTOOLS%

`

With that added, all of my "developer prompts" loaded again.

.. Please note, that batch file should be one statement per line, but I can't seem to format it here.
.. Also, you'll have to save it as admin, as the file vsdevcmd_start.bat lives in a "highly protected" area :D

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,545 questions
Not Monitored
Not Monitored
Tag not monitored by Microsoft.
36,262 questions
{count} votes