Batch file: Open cmd, run VS Command Prompt, execute Makecert

for-each picture for-each · Feb 7, 2013 · Viewed 11.9k times · Source

I need to do this in a batch file:

  1. Open cmd
  2. Run VS Command Prompt via cmd
  3. Execute this command "makecert -sv SignRoot.pvk -cy authority -r sha1 -a -n \"CN=Certificate\" -ss my -sr localmachine certificate.cer"

So far, I've done 1 and 2, my problem is getting into #3.

Here's what I have so far.

start  cmd.exe /k "%comspec% /c  "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86"

Answer

gremwell picture gremwell · May 7, 2013

This is what I've done to open up a Qt 5.0.2 command prompt with VS2012 setup and my own batch file run:

C:\Windows\System32\cmd.exe /A /Q /K C:\Qt\Qt5.0.2\5.0.2\msvc2012_64\bin\qtenv2.bat & call "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" x64 & cd c:\tkbt\Launch2.0.0 & call SetupEnvVars.bat

Drops me in the right spot with all the environment variables all set up.

So the answer to your question is to append your next call after an "&"