Microsoft Developer Network > Página Inicial dos Fóruns > Visual Studio Extensibility > Open Visual Studio 2008 Command Prompt Here Context Menu
Fazer uma PerguntaFazer uma Pergunta
 

Discussão GeralOpen Visual Studio 2008 Command Prompt Here Context Menu

  • quarta-feira, 3 de setembro de 2008 19:05devsuldier Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     Contém Código
    I have put together some registry keys to add a Visual Studio 2008 Command Prompt context menu when a user "shift + right-clicks".
    Note: It is assumed that visual studio is installed in the default location on c:

              (for new registry users:  to install, 
              1:  copy everything in bold and past into a new textpad file, 
              2:  save the file as .reg  
              3:  Open the start menu and run regedit.exe
              4:  Open 'File' > 'Import  
              5:  Find file location and click ok 

              If the keys are added successfully you'll see a prompt saying so

    Windows Registry Editor Version 5.00

    [HKEY_CLASSES_ROOT\Directory\Background\shell\VS2008 Command Prompt]
    @="Open VS2008 Command Prompt Here"
    "Extended"=""
    "NoWorkingDirectory"=""

    [HKEY_CLASSES_ROOT\Directory\Background\shell\VS2008 Command Prompt\command]
    @="C:\\Windows\\System32\\cmd.exe /s /k \"pushd %V && \"C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\vcvarsall.bat\"\" x86 "

    [HKEY_CLASSES_ROOT\Directory\shell\VS2008 Command Prompt]
    @="Open VS2008 Command Prompt Here"
    "Extended"=""
    "NoWorkingDirectory"=""

    [HKEY_CLASSES_ROOT\Directory\shell\VS2008 Command Prompt\command]
    @="C:\\Windows\\System32\\cmd.exe /s /k \"pushd %V && \"C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\vcvarsall.bat\"\" x86 "

    [HKEY_CLASSES_ROOT\Drive\shell\VS2008 Command Prompt]
    @="Open VS2008 Command Prompt Here"
    "Extended"=""
    "NoWorkingDirectory"=""

    [HKEY_CLASSES_ROOT\Drive\shell\VS2008 Command Prompt\command]
    @="C:\\Windows\\System32\\cmd.exe /s /k \"pushd %V && \"C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\vcvarsall.bat\"\" x86 "



    • Editadodevsuldier quarta-feira, 3 de setembro de 2008 19:11none
    • MovidoJon LangdonMSFTsábado, 13 de setembro de 2008 2:21more appropriate forum (Moved from Building Development and Diagnostic Tools for .Net to Visual Studio Extensibility)
    •  

Todas as Respostas

  • quarta-feira, 26 de novembro de 2008 11:24Erik Burger Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    Hi devsuldier,

    Thanks for this! I noticed an error with the pushd %V command that caused it to not work on my Windows XP SP2 machine so I went ahead and modified your script a little bit (basically replacing pushd %V with cd \"%1\".

    I added a batch file to automatically add the entries to the registry on startup (my current employer resets the registry at reboot :S). You can find more information on my blog (here).

    Cheers,
    Erik