Export (0) Print
Expand All
6 out of 12 rated this helpful - Rate this topic

Using Script Encoder

The Script Encoder encodes only scripting code, with all other file content left untouched to appear as plain text. To use the Script Encoder, develop and debug your script in the usual manner, then use this utility to encode your final script. The Script Encoder uses markers within your source code to identify where encoding should begin.

Note Note:

The Script Encoder is not supported in Windows Vista or Windows 7.

For Visual Basic Scripting Edition (VBScript), the following example illustrates how the encoding marker is used to expose a plain-text copyright message:

'Copyright© 1998. Contoso, Ltd. All rights reserved.
'**Start Encode**
' Your code goes here.

In JScript, the encoding marker looks like this:

//Copyright© 1998. Contoso, Ltd. All rights reserved.
//**Start Encode**
// Your code goes here.

When the Script Encoder is invoked, anything in the script block before the start marker is left unencoded, while everything else in the script block is encoded. Therefore, if the start marker is omitted, the entire scripting block is encoded, but if the start marker is at the end of the scripting block, nothing is encoded.

After the encoding takes place, you should be aware that the language designator in the <SCRIPT> tag has changed. For VBScript, the new designator looks like this:


For JScript, the new designator looks like this:

<SCRIPT LANGUAGE="JScript.Encode">

The Script Encoder is invoked on the MS-DOS command line or in the Run dialog box as follows:

SRCENC [switches] inputfile outputfile

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft. All rights reserved.