∟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:
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:
We checked the IIS setting to ensure that ASP is supported.
We created a simple ASP page - a HTML document with a simple VBScript code.
The VBScript code calls the "response.write" function,
which is a function provided by the IIS host environment
to insert a text string into the HTML document.
We ran IE to view the resulting HTML document generated by IIS
and got exactly what we expected.