Signs a script using a digital signature.
Object.SignFile (FileName, Certificate, Store)
In order to sign a digital signature, the author must have a valid certificate.
The following example demonstrates not only signature checking but also the command-line argument.
<job> <runtime> <named name="file" helpstring="the file to sign" required="true" type="string"/> <named name="cert" helpstring="the name of the signing certificate" required="true" type="string"/> <named name="store" helpstring="the name of the certificate store" required="false" type="string"/> </runtime> <script language="vbscript"> Dim Signer, File, Cert, Store If Not (WScript.Arguments.Named.Exists("cert") And WScript.Arguments.Named.Exists("file")) Then WScript.Arguments.ShowUsage WScript.Quit End If Set Signer = CreateObject("Scripting.Signer") File = WScript.Arguments.Named("file") Cert = WScript.Arguments.Named("cert") If WScript.Arguments.Named.Exists("store") Then Store = WScript.Arguments.Named("store") Else Store = "my" End If Signer.SignFile File, Cert, Store </script> </job>
Scripting.Signer Object | Sign Method | Verify Method | VerifyFile Method | Signing a Script