对于VISTA X64版本上安装的Visual Studio 2005,导入如下注册项:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Folder\shell\VS2005CMD]
[HKEY_CLASSES_ROOT\Folder\shell\VS2005CMD\command]
@="cmd.exe /k \"C:\\Program Files (x86)\\Microsoft Visual Studio 8\\Common7\\Tools\\vsvars32.bat\" & pushd %L"
[HKEY_CLASSES_ROOT\Folder\shell\VS2005CMD]
[HKEY_CLASSES_ROOT\Folder\shell\VS2005CMD\command]
@="cmd.exe /k \"C:\\Program Files (x86)\\Microsoft Visual Studio 8\\Common7\\Tools\\vsvars32.bat\" & pushd %L"
对于VISTA X86版本上安装的Visual Studio 2008,导入如下注册项:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Folder\shell\VS2008CMD]
[HKEY_CLASSES_ROOT\Folder\shell\VS2008CMD\command]
@="cmd.exe /k \"C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\Tools\\vsvars32.bat\" & pushd %L"
[HKEY_CLASSES_ROOT\Folder\shell\VS2008CMD]
[HKEY_CLASSES_ROOT\Folder\shell\VS2008CMD\command]
@="cmd.exe /k \"C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\Tools\\vsvars32.bat\" & pushd %L"
cmd.exe /k后的&符号表示连续运行下一命令。
参考:
Command Shell Overview