Sign in to follow this  
Followers 0
Rav1

Import a certificate

5 posts in this topic

#1 ·  Posted (edited)

Hey gang.

Anyone have any idea why this isn't importing?  It does work as a bat file...

RunWait(@ComSpec & " /c " & "c:\windows\system32\certutil.exe -addstore -f TrusterPublisher c:\setup\NCInstall.cer","",@SW_HIDE)

Thoughts?

 

Thanks

Rav

Edited by Rav1

Share this post


Link to post
Share on other sites



What do you see in the output window when you change the /c to /k, and change from @SW_HIDE to @SW_SHOW? Is the command formatted as you would expect?


When you're dead, you don't know you're dead - it's only difficult for those that know you. It's the same way when you're stupid...

My Scripts: SCCM UDFInclude Source with Compiled Script, Windows Firewall UDF

Share this post


Link to post
Share on other sites

The cli doesn't show the command that was entered.  It just shows me a lot of key specifics and "-addstore command completed successfully".  It gives me a lot more information than if I simply type the command in the run line but both ways end with "-addstore command completed successfully".  

Is it possible that I don't have the syntax for the switches for the command setup properly?

Share this post


Link to post
Share on other sites

What I typically do if I am wondering whether I have lopsided quotes or a switch wrong is to do a ConsoleWrite on the command I want to output to the console:

ConsoleWrite("c:\windows\system32\certutil.exe -addstore -f TrusterPublisher c:\setup\NCInstall.cer" & @CRLF)

If you can copy that from the consolewrite window and it runs correctly in the command line, you know your syntax is not the issue.


When you're dead, you don't know you're dead - it's only difficult for those that know you. It's the same way when you're stupid...

My Scripts: SCCM UDFInclude Source with Compiled Script, Windows Firewall UDF

Share this post


Link to post
Share on other sites

Wow.  Thats awesome.  I didn't know about ConsoleWrite.  

The syntax that was given in the console was correct.  I was able to copy and paste into the command window and it accepted it and now the cert shows up in certmgr. Apparently the problem isn't with my line....I'll check out other things.

Thanks for the help and tip!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0