Jump to content
Sign in to follow this  
VIP

Can't run pvk2pfx PVK/CER to PFX file on AutoIt

Recommended Posts

; ERROR: File not found.
; (Error Code = 0x80070002).

Type to CMD windows or RUN will OK 

Why?

 

#include <File.au3>
Global $vOutputFileName='Trong Cert'
Global $vSaveToDir=@DesktopDir
Global $vPassword='I Love You'
Global $pvk2pfxEXE="C:\Program Files\Sign Tools\pvk2pfx.exe"
If ($vSaveToDir <> "") And ((Not StringInStr($vSaveToDir, "\")) Or (Not StringInStr($vSaveToDir, ":")) Or StringInStr($vSaveToDir, "..\")) Then $vSaveToDir = _PathFull($vSaveToDir, @ScriptDir)
If Not FileExists($vSaveToDir) Then DirCreate($vSaveToDir)
Global $zPath=$vSaveToDir&'\'&$vOutputFileName
If FileExists($zPath & '.pvk') And FileExists($zPath & '.cer') Then
    Local $xCMD = '"' & $pvk2pfxEXE & '" -pvk "' & $zPath & '.pvk" -spc "' & $zPath & '.cer" -pfx "' & $zPath & '.pfx" -pi "' & $vPassword & '"'
    ConsoleWrite($xCMD & @CRLF)
    Run($xCMD, $vSaveToDir)
    ; ERROR: File not found.
    ; (Error Code = 0x80070002).
    ; Run('"'&$xCMD&'"', $vSaveToDir)
    ; Run(@ComSpec & ' /c '&$xCMD, $vSaveToDir)
    ; Run('"'&@ComSpec & '" /c '&$xCMD, $vSaveToDir)
    ;Type to CMD windows or RUN will OK: "C:\Program Files\Sign Tools\pvk2pfx.exe" -pvk "C:\Users\TrOnG\Desktop\OP.pvk" -spc "C:\Users\TrOnG\Desktop\OP.cer" -pfx "C:\Users\TrOnG\Desktop\OP.pfx" -pi "PW"
    ;But can't run with Autoit! Why?
EndIf

 

PVK2PFX.zip

Edited by Trong
add pvk2pfx.exe and PVK/CER demo

Share this post


Link to post
Share on other sites

Is a "dot" missing from this line ?  (column 29)

Local $xCMD = '"' & $pvk2pfxEXE & '" -pvk "' & $zPath & '.pvk" -spc "' & $zPath & '.cer" -pfx "' & $zPath & '.pfx" -pi "' & $vPassword & '"'
 

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  

×
×
  • Create New...