VBScript Tutorials - Herong's Tutorial Examples - Version 5.23, by Dr. Herong Yang
Using VBScript with Internet Information Services
This section provides tutorial example on how to embed a VBScript code in a HTML document to be executed by IIS (Internet Information Services) on the server machine.
Internet Information Services (IIS) is a Microsoft product that offers and manages the Internet services, like the Web (HTTP) server, and the email (SMTP) server.
IIS also supports a VBScript host environment that allows you to embed VBScript codes into source codes of Web pages - HTML documents. VBScript codes embeded in HTML documents will be executed while IIS is fetching HTML documents on the Web server to deliver to the client machine. This is also called server side scripting, becauses script codes are executed on the server machine instead of the client machine.
One way to add VBScript codes into your HTML documents for IIS to execute is to use the ASP (Active Server Pages) technology. If you have IIS installed on your Windows system, you can use the following steps to run a simple VBScript code in IIS.
1. Go to Control Panel, then Administrative Tools, then Internet Services Manager, and right mouse click on Default Web Site, then select properties command.
2. Click on Home Directory tab on the properties dialog box, then click the Configuration button.
3. Click on App Mappings tab on the configuration dialog box, then check to see the following line in the mapping area to make sure that ASP is supported by IIS:
Extension Executable Path Verbs .asp c:\winnt\system32\inetsrv\asp.dll GET,HEAD,POST,TRACE
4. Create the following hello.asp file:
<%@ language="vbscript"%> <html><body> <% response.write("Hello world! - VBScript in IIS") %> </body></html>
5. Copy hello.asp to \inetpub\wwwroot, which is the directory where IIS takes HTML documents.
6. Run Internet Explorer (IE) with this url: http://localhost/hello.asp.
7. You should see "Hello world! - VBScript in IIS" on the IE window.
Congratulations. You have successfully written a VBScript code for the host environment supported in IIS!
What happened here was:
Table of Contents