VerifyFile Method
Verifies the digital signature encapsulated in a script.
Object.
VerifyFile (FileName, ShowUI)
Description
The following example demonstrates signature checking using the command-line argument processing features.
<job>
<runtime>
<named name="file" helpstring="the file to sign" required="true" type="string"/>
<named name="UI" helpstring="produce user interface for untrusted scripts" required="false"/>
</runtime>
<script language="vbscript">
Dim Signer, File, UI, OK
If Not WScript.Arguments.Named.Exists("file") Then
WScript.Arguments.ShowUsage
WScript.Quit
End If
Set Signer = CreateObject("Scripting.Signer")
File = WScript.Arguments.Named("file")
UI = WScript.Arguments.Named.Exists("ui")
OK = Signer.VerifyFile(File, UI)
If OK Then
WScript.Echo File & " is trusted."
Else
WScript.Echo File & " is NOT trusted."
End If
</script>
</job>
Applies To:
Community Additions
Show:
Note: