Learn VBScript – Part 1 of 4 www.srinimf.com
What is VBScript • VBScript is a scripting language. It is designed to allow you to write scripts that can automate any number of activities, such as adding simple animation to a web page. • Unlike some programming languages VBScript cannot run on its own. • It requires an execution host. An execution host is another program, such as a web browser, that interprets and executes your script.
Usage of VBScript • Validating HTML forms before submitting their contents as email. • Creating animation effects such as a rollover, which changes the appearance of a graphic, such as a button, when the mouse moves the pointer over it. • Creating rotating banners. • Interacting with visitors using pop-up dialogs to display messages and collect information etc.
Where? VBScripts executed in Internet Explorer Windows Script Host Internet Information Server and ASP Outlook Express Microsoft Windows Script Console
VB Family •Visual Basic •Visual Basic for Applications •VBScript
Integrating Code • VBScript is inserted or embedded into an HTML page using the <SCRIPT> and </SCRIPT> tags. The script tags can be placed in either the head or body section of an HTML page. • There are two forms of the script tags that you’ll see presented in this book. • The most commonly used syntax is shown here: <SCRIPT LANGUAGE="Script_Language" TYPE="TEXT/Language" SRC="url"> </SCRIPT
Script in HTML Page <HTML> <HEAD> <TITLE>Script 1.1 - Adding VBScript to a HTML page</TITLE> <SCRIPT LANGUAGE="VBScript"> sub window_onload msgbox "Welcome to the world of VBScripting!" end sub </SCRIPT> </HEAD> <BODY> <H3>My first VBScript! </BODY> </HTML>
WSH • Also called windows scripting host • VBScript’s role as a client-side Internet scripting language • You can install or upgrade to WSH version 5.6 on any Windows 95 or later operating system. You can download WSH 5.6 from www.msdn.microsoft.com/scripting
WSH Architecture
VB Script basics Comment
Cont.… •Wscript.exe and Cscript.exe execution environments provide equivalent functionality
Running VBScript in Command mode
What next •This is just part-1. I will post all relevant topics on VBScript in my coming posts - Part-2, Part- 3,Part-4
Thank You www.srinimf.com

Learn VBScript – Part 1 of 4

  • 1.
    Learn VBScript –Part 1 of 4 www.srinimf.com
  • 2.
    What is VBScript •VBScript is a scripting language. It is designed to allow you to write scripts that can automate any number of activities, such as adding simple animation to a web page. • Unlike some programming languages VBScript cannot run on its own. • It requires an execution host. An execution host is another program, such as a web browser, that interprets and executes your script.
  • 3.
    Usage of VBScript •Validating HTML forms before submitting their contents as email. • Creating animation effects such as a rollover, which changes the appearance of a graphic, such as a button, when the mouse moves the pointer over it. • Creating rotating banners. • Interacting with visitors using pop-up dialogs to display messages and collect information etc.
  • 4.
    Where? VBScripts executed in InternetExplorer Windows Script Host Internet Information Server and ASP Outlook Express Microsoft Windows Script Console
  • 5.
    VB Family •Visual Basic •VisualBasic for Applications •VBScript
  • 6.
    Integrating Code • VBScriptis inserted or embedded into an HTML page using the <SCRIPT> and </SCRIPT> tags. The script tags can be placed in either the head or body section of an HTML page. • There are two forms of the script tags that you’ll see presented in this book. • The most commonly used syntax is shown here: <SCRIPT LANGUAGE="Script_Language" TYPE="TEXT/Language" SRC="url"> </SCRIPT
  • 7.
    Script in HTMLPage <HTML> <HEAD> <TITLE>Script 1.1 - Adding VBScript to a HTML page</TITLE> <SCRIPT LANGUAGE="VBScript"> sub window_onload msgbox "Welcome to the world of VBScripting!" end sub </SCRIPT> </HEAD> <BODY> <H3>My first VBScript! </BODY> </HTML>
  • 8.
    WSH • Also calledwindows scripting host • VBScript’s role as a client-side Internet scripting language • You can install or upgrade to WSH version 5.6 on any Windows 95 or later operating system. You can download WSH 5.6 from www.msdn.microsoft.com/scripting
  • 9.
  • 10.
  • 11.
    Cont.… •Wscript.exe and Cscript.exe executionenvironments provide equivalent functionality
  • 12.
    Running VBScript inCommand mode
  • 13.
    What next •This isjust part-1. I will post all relevant topics on VBScript in my coming posts - Part-2, Part- 3,Part-4
  • 14.