Timothy Shenton
Timothy Shenton

Reputation: 65

Windows START command loading wrong version of Visual Studio

I just upgraded from Visual Studio 2017 to Visual Studio 2019 (queue the applause). All is well and good, and I have both environments running, but...

I have a batch file that I use to start VS 2017 using the windows START and a bunch of other programs (fiddler, postman, etc). When I changed the path in the batch file to use visual studio 2019 it still loads up visual studio 2017

Neither of the Visual Studio environments are in my path and when I run the command from my command prompt

"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\devenv.exe" 

it loads up visual studio 2019 (yay), but when I use the START command it loads visual studio 2017.

I am on a windows 10 machine with Command Extensions turned on

START /d "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\" devenv.exe 

Anyone have any idea why the START Command is loading vs2017?

Thanks

Upvotes: 1

Views: 506

Answers (1)

StephaneM
StephaneM

Reputation: 4899

start /D "somepath" somexecutable

does not starts the executable located in somepath, it merely sets the current working directory to somepath.

What you want is this:

START /D "somepath" "somepath/somexecutable"

which in your case expands to

START /d "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\" "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\devenv.exe"

But even though you think devenv is not in your path, it must be somehow. To find where it is found try

where devenv

Upvotes: 3

Related Questions