Trong Posted November 11, 2015 Posted November 11, 2015 (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 November 11, 2015 by Trong add pvk2pfx.exe and PVK/CER demo Regards,
JohnOne Posted November 12, 2015 Posted November 12, 2015 show what $zPath is equal to. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Trong Posted November 12, 2015 Author Posted November 12, 2015 Global $zPath=$vSaveToDir&'\'&$vOutputFileName ;$zPath & '.pvk' ;$zPath & '.cer' ;--> $vSaveToDir = C:\Windows ;--> $vOutputFileName = FileCerName ;---------> C:\Windows\FileCerName.cer ;---------> C:\Windows\FileCerName.pvk ' Regards,
PACaleala Posted November 12, 2015 Posted November 12, 2015 Is a "dot" missing from this line ? (column 29)Local $xCMD = '"' & $pvk2pfxEXE & '" -pvk "' & $zPath & '.pvk" -spc "' & $zPath & '.cer" -pfx "' & $zPath & '.pfx" -pi "' & $vPassword & '"'
PACaleala Posted November 14, 2015 Posted November 14, 2015 Did you download pvk2pfx from Microsoft ?
PACaleala Posted November 16, 2015 Posted November 16, 2015 You did not use the full path or the correct name for pvk2pfx"DOT"exe.Review lines 10 and 18.
Trong Posted November 16, 2015 Author Posted November 16, 2015 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,
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now