locked
Certutil won't run in startup task RRS feed

  • Question

  • I have a startup task in a .cmd file that looks like this:

    certutil.exe -addstore -f "TRUSTEDPEOPLE" "mysslcert.cer"

    My .csdef file looks like this:

        <Startup>      <Task commandLine="Startup\InstallVcRedist.cmd" executionContext="elevated" taskType="simple" />
          <Task commandLine="Startup\AddUrlAcl.cmd" executionContext="elevated" taskType="simple" />      
    <
    Task commandLine="Startup\InstallCert.cmd" executionContext="elevated" taskType="simple" />    
    </
    Startup>


    I am installing VC++, setting up a URLAcl and then trying to install this cert in a store.

    What happens is that the role just sits there spinning in the Azure portal. I can remote into the instance and actually run this cmd file with no errors and it works.

    I'm not sure why certutil can't run without me remoting into the machine. Any ideas?


    Thanks!

    STom

    Monday, November 26, 2012 6:01 PM

Answers

  • I figured it out.  I had to change the command to:

    certutil.exe -addstore -f "TRUSTEDPEOPLE" "Startup\mysslcert.cer"

    The problem was that although the .cmd file was running from the Startup folder, certutil was looking in it's directory for the certificate.

    Thanks!


    STom

    • Marked as answer by stombiztalker Monday, November 26, 2012 7:16 PM
    Monday, November 26, 2012 7:16 PM

All replies

  • I figured it out.  I had to change the command to:

    certutil.exe -addstore -f "TRUSTEDPEOPLE" "Startup\mysslcert.cer"

    The problem was that although the .cmd file was running from the Startup folder, certutil was looking in it's directory for the certificate.

    Thanks!


    STom

    • Marked as answer by stombiztalker Monday, November 26, 2012 7:16 PM
    Monday, November 26, 2012 7:16 PM
  • Hi, I'm glad to hear that you resolve this issue. Thank you for sharing your solutions and experience here.

    Please mark the replies as answers if they help or unmark if not. If you have any feedback about my replies, please contact msdnmg@microsoft.com Microsoft One Code Framework

    Tuesday, November 27, 2012 7:41 AM