It's because the Batch files it runs are using Set
to set the environment variables (C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64\vcvars64.bat
is what gets run when you run vcvarsall x64
).
But Set
only sets variables for the current command line session. You need to use Setx
to have it "stick" between command line sessions.
For more info, perhaps check out these other SU questions and answers:
Edit after comments:
"But the set commands were in the default script"
VCVarsAll is intended to be run to setup the environment for the single build/action you are about to do, not to set them permanently.
Visual Studio installs specific "command prompt" entries for accessing the tools (From your link: "...and then choose one of the native-tool or cross-tool command prompts."), and those special command prompt shortcuts run a/the batch file to ensure things are set right when you use those shortcuts.
You can replicate those shortcuts with your own...
Make a new shortcut to cmd /k "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x64
, which will run the batch file (using x64 as the environment option), and then keep the command-line window open.
Then use that shortcut to open the command prompt when you want to use the tools.