55

What is the location of file:

VCVARSALL.BAT

for Visual studio 2017?

Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194
Starnuto di topo
  • 3,215
  • 5
  • 32
  • 66
  • 8
    C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build, substitute "Enterprise" with your edition name. – Hans Passant Apr 12 '17 at 14:26
  • 1
    For the Community edition, there's no Build directory in C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\ – Starnuto di topo Apr 12 '17 at 14:43
  • 5
    Oh, it is surely there, but you do have to install the C++ tooling when you what to use anything that starts with "vc". Clearly you cannot omit the edition and the kind of language you want to use from the question if you want a helpdesk answer. – Hans Passant Apr 12 '17 at 14:45

5 Answers5

65

To summarize, sth along the lines of

"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x64

or

"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\vsdevcmd" -arch=x64

(try running it with -help)


My environment:

** Visual Studio 2017 Developer Command Prompt v15.0.26403.7

on Win10 x64

nodakai
  • 7,773
  • 3
  • 30
  • 60
30

Hans Passant is right.
I had the same problem: no VCVARSALL.BAT for my VS2017 and no Build folder in Microsoft Visual Studio\2017\Community\VC\Auxiliary. I have Visual Studio Community 2015 and 2017 installed on the same machine.
I didn't have Desktop development with C++ check in my installation. I installed it and the Build folder was created! Now everything work great. Visual Studio Community 2017

benichka
  • 925
  • 1
  • 11
  • 32
7

VS2017 has reworked its directory structure and filenames. You should look for the file 'vcvars.bat', which can be located in "..\Program Files (x86)\Microsoft Visual Studio\2017\EDITION\Common7\Tools\vsdevcmd\ext\vcvars.bat" (replace EDITION with the version of Visual Studio you use).

For simplicity, you can use "%VSAPPIDDIR%" in your call to point to the IDE folder where devenv.exe is located, and go back one folder to define your path to the batch file. For example:

call "%VSAPPIDDIR%..\Tools\vsdevcmd\ext\vcvars.bat"
  • 1
    I have no "vsdevcmd" folder in "..\Program Files (x86)\Microsoft Visual Studio\2017\EDITION\Common7\Tools\" . Instead, I see lot of .bat directly in "..\Program Files (x86)\Microsoft Visual Studio\2017\EDITION\Common7\Tools\", but not vcvars.bat: VCVarsPhoneQueryRegistry.bat vcvarsqueryregistry.bat VsDevCmd.bat VsMSBuildCmd.bat vsvars32.bat – Starnuto di topo Jul 03 '17 at 07:09
  • @Starnuto di topo - maybe take a look at [this issue](https://github.com/Microsoft/vcpkg/issues/759). It could likely be an issue with your VS install. While I don't necessarily like to go right to suggesting a reinstall, this did seem to worked for martin-traverse – Sentient Entities Jul 04 '17 at 07:17
  • 4
    That vcvars.bat does not seem to do the same thing as vcvarsall. – Hamish Moffatt Oct 16 '17 at 01:40
  • 1
    The location in 2017 seems to be C:\Program Files (x86)\Microsoft Visual Studio\2017\EDITION\VC\Auxiliary\Build. If you don't find it there, make sure C++ tools are installed. Hamish was correct; vcvars.bat is not the same thing at all. – Mike Mar 10 '20 at 21:36
1

The VC folder is within the Desktop development with C++ workload. Go to your add or remove programs and modify your Visual Studio 2017, and choose it as shown below:

enter image description here

click on Modify (or Install/Setup in other devices). Go check your folder *\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build* and you'll see the the vcvars64.bat.

Jade Cacho
  • 691
  • 6
  • 9
-1

I had the same problem - was fixed by removing and reinstalling latest version of microsoft office (2017-2019) resolved the issue. The folder should exist in your MS path automatically, if its not there, uninstall and redownload and install - on my system takes around 3 hours.

El_1988
  • 339
  • 3
  • 13