我正在使用 cl
在 cmd
并且必须运行 vcvars32.bat
每次打开cmd
window下的axx真的很痛。谁能提供一种自动运行它的方法?
最佳答案
来自 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
因此,您可以添加
vcvars32.bat
到这些 AutoRun 注册表值之一,以便为每个 cmd.exe
执行它实例(当然,明确指定 /D
时除外)。但是,预先警告这样做可能会导致其他奇怪的副作用(例如,它可能会导致其他
.bat
/.cmd
脚本在它们不期望的环境中运行)。
关于batch-file - 有没有办法在每次启动 cmd 时运行 vcvars32.bat?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17689152/