Jump to content

Recommended Posts

Posted (edited)

; 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,
 

Posted
Global $zPath=$vSaveToDir&'\'&$vOutputFileName
;$zPath & '.pvk' 
;$zPath & '.cer'
;--> $vSaveToDir = C:\Windows
;--> $vOutputFileName = FileCerName
;---------> C:\Windows\FileCerName.cer 
;---------> C:\Windows\FileCerName.pvk
'

 

 

 

 

Regards,
 

Posted

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

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

Posted

I am sure the path is correct, because the program has run.
But the result was not found error message file (probably PVK, .pfx)
The same statement on if typed in the console window works very well.

Regards,
 

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
  • Recently Browsing   0 members

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