The system cannot find the file specified in Developer Command Prompt for VS 2022
Asked Answered
I

3

7

Running Developer Command Prompt for VS 2022

Previously, I didn't get this error.

After try some attempt modifying the shortcut launcher using administrator, this error happens. Roll back the path and command for the launcher, keeps this error.

**********************************************************************
** Visual Studio 2022 Developer Command Prompt v17.1.3
** Copyright (c) 2022 Microsoft Corporation
**********************************************************************
The system cannot find the file specified.
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools>

How to fix this?


I've read this SO Answer but, in my case, there is already no AutoRun.


Open the .bat file from cmd also did not work.

PS C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\Tools> VsDevCmd.bat
**********************************************************************
** Visual Studio 2022 Developer Command Prompt v17.1.3
** Copyright (c) 2022 Microsoft Corporation
**********************************************************************
The system cannot find the file specified.
Influential answered 10/4, 2022 at 1:39 Comment(0)
I
4

Modify and Repair from Visual Studio Build Tools solve the problem.

Make sure to check some optional download shown here:enter image description here (if you can't open imgur, here is the image).

See this VSCode tutorial page on installing Visual Studio Build Tools.

Influential answered 10/4, 2022 at 3:27 Comment(2)
I followed your solution twice, but it doesn't work for me. Leaving this here for others to confirm.Measurable
@Measurable Other tutorial and step by step installation that help me is this one here. Hope you able to install or fix your installation issue.Influential
S
0

I found that installing the Visual Studio Community 2022 selecting the following packages fixes it:

  • w10 sdk
  • universal windows platform tools

They also try to shoehorn their Windows Copilot... but you can disable that package.

Supranational answered 13/6 at 13:54 Comment(0)
L
-2

I don't think OP launched the correct file for VS Build Tools 2022.

The correct one would be Launch-VsDevShell.ps1:

C:\Users\Administrator> & 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\Tools\Launch-VsDevShell.ps1'
**********************************************************************
** Visual Studio 2022 Developer PowerShell v17.5.4
** Copyright (c) 2022 Microsoft Corporation
**********************************************************************
C:\Users\Administrator>

The console above is from my Windows 2022 server with VS Build Tools 2022 installed.

Also, observe that you can also use this official PowerShell module from Microsoft to find the installation directory of the VS Build Tools:

C:\Users\Administrator> $buildToolsHome = Get-VSSetupInstance | Select -ExpandProperty InstallationPath
C:\Users\Administrator> & "${buildToolsHome}\Common7\Tools\Launch-VsDevShell.ps1"
**********************************************************************
** Visual Studio 2022 Developer PowerShell v17.5.4
** Copyright (c) 2022 Microsoft Corporation
**********************************************************************
C:\Users\Administrator>
Lavaliere answered 13/4, 2023 at 14:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.