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?

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.

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

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.

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

This question has already been answered. Start a new discussion instead.