I'm trying to read a user's PKI card data with Certutil and dump the data to a text file. The idea is to put this as part of a login script to gather some data on user's with expiring certificates.
Here is my code section:
set oShell = WScript.CreateObject("WScript.Shell")
strcommand = "cmd /c certutil -scinfo -silent > " & StrPath
oShell.Run strcommand, true
it seems to work, dumping the cert data to a text file (strpath variable), but once I add more lines to the script it never waits for the command window to finish. It just closes in a fraction of a second or so. I know it takes aobut 7 seconds to read the PKI Card. I've tried sleep as well as a do/while loop and nothing seems to allow the command window run its course. I've also tried the various intwindowstyle options listed here.
Appreciate any help.