Jump to content

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


Trong
 Share

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

Regards,
 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...