Hinweis
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, sich anzumelden oder das Verzeichnis zu wechseln.
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, das Verzeichnis zu wechseln.
Signs a script using a digital signature.
Syntax
Object.SignFile (FileName, Certificate, Store)
Arguments
object
Scripting.SignerFileName
A string containing the name of the script file.Certificate
A string designating the author's certificate name.Store
An optional string designating the name of the certificate store. Typically certificates that contain private keys — i.e., certificates you can use for code signing — are in a certificate store called "my". The default value is "my".
Remarks
In order to sign a digital signature, the author must have a valid certificate.
Legacy Code Example
Description
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>
Applies To:
See Also
Sign Method
Verify Method
VerifyFile Method
Signing a Script (Windows Script Host)