Using a variable from a VBScript in a ASP.Net website

David,

As a person new to Stack Overflow myself, I was happy to find this very comprehensive FAQ for Stack Exchange sites. See the 3rd question “Is there a limit on how many questions I can ask?” for an answer to your first inquiry.

Regarding the heart of your question, I agree with @Ramhound that using a log file to exchange information between your WSH/VBScript script and your ASP.NET page is a feasible approach.

What you need is the Scripting.FileSystemObject. Here is a comprehensive WSH reference as a downloadable Windows help file.

Hint: as the download page advises at the bottom, to unblock the help page, 1) Right click on script56.chm, 2) Choose Properties, and 3) Click on “Unblock.”

You’ll find an intro to FileSystemObject under the heading “Script Runtime.”

One more suggestion: since you’ll be running this script via ASP.NET in a multi-user environment, you may find you’ll need to create a log file per user or per page access. If that is the case, you’ll need to generate a temporary file name for each log file to avoid name collisions with other log files. To generate your temporary file, see GetTempName in the WSH reference.

Leave a Comment