954,136 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Problems with Windows Script Encoder & #include directive

When using the windows script encoder to encode ASP files that include other ASP files that are also encoded using the windows script encoder, I receive an IIS ASP compiler error message indicating that the @ language directive can only be used once when the interpreter encounters the second @ langauage symbol in the first file that is included.

Can you guys help?

brob5000
Newbie Poster
22 posts since Jul 2004
Reputation Points: 12
Solved Threads: 0
 

remove the @language directive if you are using vbscript.

RobUK
Light Poster
32 posts since Jul 2004
Reputation Points: 10
Solved Threads: 1
 

Thanks for the suggestion. I do not have any @language directives in my scripts prior to passing them through the windows script encoder. The windows script encoder adds the @language directive to the encoded file because the output of the windows script encoder is an "encoded" VBScript file.

At the top of any encoded file, you will find "<% @ LANGUAGE = VBScript.Encode %>"

I also thought about removing the directive afterwards, but according to the documentation on the windows script encoder ( Documentation ), if any modifications are made to the encoded file, it will not decode properly -- "After a script is encoded, changing any part of the resulting file will render it inoperable, thus ensuring the absolute integrity of your encoded script." -Microsoft

Ben Roberts
Azalea Technology, LLC.

brob5000
Newbie Poster
22 posts since Jul 2004
Reputation Points: 12
Solved Threads: 0
 

I think you can strip the language directive on the includes (after encoding).

RobUK
Light Poster
32 posts since Jul 2004
Reputation Points: 10
Solved Threads: 1
 

Actually, when encoding entire directories, use the /xl switch... this stops the encoder from adding the language directive.

You can then add it in manually for non-includes.

RobUK
Light Poster
32 posts since Jul 2004
Reputation Points: 10
Solved Threads: 1
 

I will give that a try. Thanks!

brob5000
Newbie Poster
22 posts since Jul 2004
Reputation Points: 12
Solved Threads: 0
 

The -xl switch on the encoder to exclude the @ language directive worked! Thanks!

brob5000
Newbie Poster
22 posts since Jul 2004
Reputation Points: 12
Solved Threads: 0
 

No problems!

RobUK
Light Poster
32 posts since Jul 2004
Reputation Points: 10
Solved Threads: 1
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You