How to start Visual Studio 2022 from cmd
Asked Answered
H

4

7

in Visual Studio 2019 is it possible to Launch in cmd via "start devenv". Now i have installed both version 2019 and 2022, and with the same command it starts 2019 version.

Any body a idea to start vsStudio 2022 via cmd? in an easy way?

Thx for help.

Hypermetropia answered 15/7, 2022 at 5:21 Comment(1)
This question is better suited for Super User.Parturifacient
D
1
  1. In the search box of the system type "Visual Studio 2022"
  2. Right click on it and select "Open file location"
  3. Right click (again) on the direct access "Visual Studio 2022" and select "Open file location"
  4. Copy the path of that folder (Something like "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE")
  5. Go to system environment variables and in the "User variables" add to "Path" the path of the step 4.

Now you can type in cmd "start devenv" and Visual Studio 2022 will start.

Donica answered 2/2, 2023 at 23:16 Comment(0)
B
3

You can use:

  • Just to open Visual Studio start devenv
  • To open Visual Studio with the current folder start devenv .
  • To open Visual Studio specifying the Solution start devenv {your-solution-name}.sln

Like this:

enter image description here

Boundary answered 30/1, 2023 at 22:49 Comment(1)
I think you can also just run the *.sln from powershell, using ./{your-solution-name}.sln.Commandment
D
1
  1. In the search box of the system type "Visual Studio 2022"
  2. Right click on it and select "Open file location"
  3. Right click (again) on the direct access "Visual Studio 2022" and select "Open file location"
  4. Copy the path of that folder (Something like "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE")
  5. Go to system environment variables and in the "User variables" add to "Path" the path of the step 4.

Now you can type in cmd "start devenv" and Visual Studio 2022 will start.

Donica answered 2/2, 2023 at 23:16 Comment(0)
H
0

Are you launching the VS2022 command prompt? By default (in plain cmd.exe), the VS install folder is not on the %PATH%, but each of the VS versioned command prompts runs a script that will add that version's toolset to the %PATH%. Devenv or any other tools will be launched according to the versioned environment.

You can also use where devenv to probe the %PATH% of your current environment to see all of the matches (the first one would be launched if you do start devenv).

Hilliard answered 15/7, 2022 at 21:26 Comment(1)
hmm where devenv does not work.Aseptic
L
0

In taskbar windows, typing CMD by the windows search, you will have the two command prompts of 2019 and 2022 which appear, just choose and use the Visual studio command prompt you want. then type devenv

Liaoning answered 22/1, 2023 at 17:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.