VBScript

By Bryan Muehlberger, ITworld |  How-to

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
arguments.

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
verified.

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

Set objScriptingSigner = WScript.CreateObject(

Join us:
Facebook

Twitter

Pinterest

Tumblr

LinkedIn

Google+

Answers - Powered by ITworld

ITworld Answers helps you solve problems and share expertise. Ask a question or take a crack at answering the new questions below.

Join us:
Facebook

Twitter

Pinterest

Tumblr

LinkedIn

Google+

Ask a Question
randomness