Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: Install CAPICOM Windows 7 Win7 Server 2003 SP2
ObjectCreate("CAPICOM.Certificate") and CreateObject( "CAPICOM.Store.2" )we need to install the CAPICOM.I did some research on the web and got some articles such as: http://social.technet.microsoft.com/Forums/windows/en-US/b977ef42-7b65-439e-a95b-5d4d204501fd/installing-capicomdll-on-windows-7
I have tried several download but still failed to create the CAPICOM.Certificate.
I have windows 7 and Server 2003 SP2.
What can I do to be able to run : http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+WIL~Extenders/ADSI+COM~-~Active~Directory~Published~Certificates~Info~.txt and http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+WinBatch/OLE~COM~ADO~CDO~ADSI~LDAP/Samples~from~Users+Enumerate~Certificates.txt
CAPICOM is a 32-bit only component that is available for use in the following operating systems: Windows Server 2008, Windows Vista, Windows XP.
If you insist on using CAPICOM on Windows 7, you might try these steps...
%windir%\syswow64\regsvr32.exe %windir%\syswow64\capicom.dll
;use cerutil #DefineFunction udfCaptureDosOutput( DosCommand ) DebugTrace(22, ''); Allow DebugTrace continuation (inherit the debug mode from the caller). DataArray=ArrDimension(4) ;Allocate return array ArrInitialize(DataArray,"") ;initialize to all null strings ;Stuff the cmd in the 4 element of the array DataArray[3] = DosCommand oShell = ObjectCreate("WScript.Shell") ;open shell object ;If 64 bit turn off redirection? If WinMetrics(-7) == 2 ;64-bit Windows oldvalue = IntControl( 92, "disable", 0, 0, 0 ) oScriptExec = oShell.Exec(DosCommand) ;run the command IntControl( 92, "revert", oldvalue, 0, 0 ) Else oScriptExec = oShell.Exec(DosCommand) ;run the command EndIf ;Open output objects oStdOut = oScriptExec.StdOut oStdErr = oScriptExec.StdErr While (oScriptExec.Status==0) ;wait for completion ;Caputure StdOut data oStdOut = oScriptExec.StdOut While ! oStdOut.AtEndOfStream strLine = oStdOut.ReadLine DataArray[1] = StrCat(DataArray[1],strLine,@CRLF) EndWhile ;Capture StdErr data oStdErr = oScriptExec.StdErr While ! oStdErr.AtEndOfStream strLine = oStdErr.ReadLine DataArray[2] = StrCat(DataArray[2],strLine,@CRLF) EndWhile TimeDelay(0.1) EndWhile ;Get remainder of data, if any ;Caputure StdOut data oStdOut = oScriptExec.StdOut While ! oStdOut.AtEndOfStream strLine = oStdOut.ReadLine DataArray[1] = StrCat(DataArray[1],strLine,@CRLF) EndWhile ;Capture StdErr data oStdErr = oScriptExec.StdErr While ! oStdErr.AtEndOfStream strLine = oStdErr.ReadLine DataArray[2] = StrCat(DataArray[2],strLine,@CRLF) EndWhile DataArray[0]=oScriptExec.ExitCode ;save errorlevel/exit code ;Close handles that were opened oStdOut = 0 oStdErr = 0 oScriptExec = 0 oShell = 0 ;Return the array Return(DataArray) #EndFunction #DefineFunction udfDisplayResult( dataarray ) Exitcode = dataarray[0] StdOut = dataarray[1] StdErr = dataarray[2] DosCommand = dataarray[3] If stdErr != "" Message(DosCommand: " - STDERR", StdErr) Message(DosCommand:" - EXITCODE", Exitcode) Else Message(DosCommand:" - STDOUT", StdOut) EndIf Return 1 #EndFunction strFileName = '"C:\Program Files (x86)\Common Files\Adobe AIR\Versions\1.0\Resources\Thawte Root Certificate.cer"' doscmd2 = "certutil ":strFileName dataarray = udfCaptureDosOutput( doscmd2 ) ;udfDisplayResult( dataarray ) data = dataarray[1] lookfor = 'NotAfter:' startpos = StrIndex( data, lookfor , 1, @Fwdscan ) expiration = StrSub( data, startpos+StrLen(lookfor), 11 ) Pause('Certificate Expiration Date',expiration)
;dotNet x509certificate ;Alternatively you might consider using the dotNet x509certificate class: http://msdn.microsoft.com/en-us/library/system.security.cryptography.x509certificates.x509certificate.getexpirationdatestring(v=vs.90).aspx ;*************************************************************************** ;** Read Expiration date from a .CER certificate file ;** ;** Purpose: Read Expiration date from a .CER certificate file ;** Inputs: .cer file path ;** Outputs: Message with expiration date of certificate file ;** Reference: ;** REQUIRES WinBatch 2013A or newer ;** ;** Developer: Deana Falk 2013.08.28 ;*************************************************************************** If Version( )< '2013A' Pause('Notice', 'Need 2013A or Newer Version of WinBatch') Exit EndIf ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; Load assemblies into the WinBatch process. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; mscorlib assembly is automatically loaded by WinBatch when the CLR is loaded. ;ObjectClrOption ('use','mscorlib, version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089') ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; Prompt for input ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; The path to the certificate. strFileName = 'C:\Program Files (x86)\Common Files\Adobe AIR\Versions\1.0\Resources\Thawte Root Certificate.cer' ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; Associate a Framework based type name with a value. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; Create a class implemented by a managed assembly. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; Load the certificate into an X509Certificate object. X509Certificate = ObjectClrNew( 'System.Security.Cryptography.X509Certificates.X509Certificate' ) cert = X509Certificate.CreateFromCertFile(strFileName); ;Get the value. results = cert.GetExpirationDateString(); ;Display the value Pause('GetExpirationDateString', results) Exit
Article ID: W18020
Filename: Install CAPICOM on Win7.txt
File Created: 2014:07:18:09:51:38
Last Updated: 2014:07:18:09:51:38