1

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"
for-each
  • 619
  • 3
  • 7
  • 21

2 Answers2

1

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 "&"

gremwell
  • 1,419
  • 17
  • 23
0

actually, visual studio command prompt is not a special command prompt, it is the normal windows CMD but configured with some environment variables

to make the same effect in a batch file you will need to call a special batch file from visual studio installation to configure windows CMD

to do so, the very first line in your batch file should be

call "%VS120COMNTOOLS%\vsvars32.bat"

then you can call any visual studio specific command

VS120COMNTOOLS is the path environment variable for your visual studio version

mfarouk
  • 644
  • 5
  • 14