Last week we discussed how to programmatically sign your VBScripts. You

can take advantage of this feature by using the Scripting.Signer object

in Windows and Windows Scripting Host (WSH). This week we review how to

programmatically verify that a script has been signed using the

VerifyFile method.

In our previous example, we signed a script called

c:\scripts\signedScript.vbs using a certificate called "Company Script

Certificate". To verify that this script has been signed we need to

take advantage of the Scripting.Signer object along with two additional


Let's step through some sample code on how to implement this feature.

First, create a file called c:\scripts\checkSignature.vbs and copy/paste

the following code snippet into the file. Then save the file. Our

sample script will return either True meaning that the signature has

been verified, or False, meaning that the signature could not be


--------------- Begin Code Snippet ----------------

Set objScriptingSigner = WScript.CreateObject(

From CIO: 8 Free Online Courses to Grow Your Tech Skills
Join the discussion
Be the first to comment on this article. Our Commenting Policies