VerifyFile Method

VerifyFile Method


Verifies the digital signature encapsulated in a script.

Object.VerifyFile (FileName, ShowUI)




A string containing the name of the script file.


A Boolean value. If the ShowUI argument is false, then the Scripting.Signer object determines whether a trusted source provided the signature without prompting the user. If it is true then the Scripting.Signer object may create dialog boxes to prompt the user if there is not sufficient information to determine trust.


On some operating systems, the operating system also creates a dialog box if the flag is on, the file is trusted, and you have not already checked the "Always trust " option.

Legacy Code Example

The following example demonstrates signature checking using the command-line argument processing features.

<named name="file" helpstring="the file to sign" required="true" type="string"/>
<named name="UI" helpstring="produce user interface for untrusted scripts" required="false"/>
<script language="vbscript">
Dim Signer, File, UI, OK
If Not WScript.Arguments.Named.Exists("file") Then
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."
     WScript.Echo File & " is NOT trusted."
End If
© 2015 Microsoft