I'm using cl
in cmd
and having to run vcvars32.bat
every time I open a cmd
window is really a pain in the axx. Can anyone offer a way of running it automatically?
From cmd /?
:
If /D was NOT specified on the command line, then when CMD.EXE starts, it looks for the following REG_SZ/REG_EXPAND_SZ registry variables, and if either or both are present, they are executed first.
HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\AutoRun and/or HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun
You therefore could add vcvars32.bat
to one of those AutoRun registry values to have it executed for every cmd.exe
instance (except when /D
is explicitly specified, of course).
However, be forewarned that doing this could result in other weird side-effects (for example, it could cause other .bat
/.cmd
scripts to be run in an environment that they aren't expecting).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With