learn vbscript – part 1 of 4
DESCRIPTION
Learn VBScript – Part 1 of 4 in your spare time.TRANSCRIPT
![Page 1: Learn VBScript – Part 1 of 4](https://reader035.vdocuments.net/reader035/viewer/2022080209/54c17c814a79590b338b460e/html5/thumbnails/1.jpg)
Learn VBScript – Part 1 of 4
www.srinimf.com
![Page 2: Learn VBScript – Part 1 of 4](https://reader035.vdocuments.net/reader035/viewer/2022080209/54c17c814a79590b338b460e/html5/thumbnails/2.jpg)
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.
![Page 3: Learn VBScript – Part 1 of 4](https://reader035.vdocuments.net/reader035/viewer/2022080209/54c17c814a79590b338b460e/html5/thumbnails/3.jpg)
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.
![Page 4: Learn VBScript – Part 1 of 4](https://reader035.vdocuments.net/reader035/viewer/2022080209/54c17c814a79590b338b460e/html5/thumbnails/4.jpg)
Where?
VBScripts executed in Internet ExplorerWindows Script Host Internet Information Server and ASPOutlook ExpressMicrosoft Windows Script Console
![Page 5: Learn VBScript – Part 1 of 4](https://reader035.vdocuments.net/reader035/viewer/2022080209/54c17c814a79590b338b460e/html5/thumbnails/5.jpg)
VB Family
•Visual Basic•Visual Basic for Applications•VBScript
![Page 6: Learn VBScript – Part 1 of 4](https://reader035.vdocuments.net/reader035/viewer/2022080209/54c17c814a79590b338b460e/html5/thumbnails/6.jpg)
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
![Page 7: Learn VBScript – Part 1 of 4](https://reader035.vdocuments.net/reader035/viewer/2022080209/54c17c814a79590b338b460e/html5/thumbnails/7.jpg)
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>
![Page 8: Learn VBScript – Part 1 of 4](https://reader035.vdocuments.net/reader035/viewer/2022080209/54c17c814a79590b338b460e/html5/thumbnails/8.jpg)
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
![Page 9: Learn VBScript – Part 1 of 4](https://reader035.vdocuments.net/reader035/viewer/2022080209/54c17c814a79590b338b460e/html5/thumbnails/9.jpg)
WSH Architecture
![Page 10: Learn VBScript – Part 1 of 4](https://reader035.vdocuments.net/reader035/viewer/2022080209/54c17c814a79590b338b460e/html5/thumbnails/10.jpg)
VB Script basics
• VBScript is saved as a plain text file using a .vbs file extension that uses only VBScript programming statements.• 'Script 1.5—An example of a WSH VBScript
Wscript. Echo "This script works differently depending on which WSH execution environment runs it!"
Comment
![Page 11: Learn VBScript – Part 1 of 4](https://reader035.vdocuments.net/reader035/viewer/2022080209/54c17c814a79590b338b460e/html5/thumbnails/11.jpg)
Cont.…
•Wscript.exe and Cscript.exe execution environments provide equivalent functionality
![Page 12: Learn VBScript – Part 1 of 4](https://reader035.vdocuments.net/reader035/viewer/2022080209/54c17c814a79590b338b460e/html5/thumbnails/12.jpg)
Running VBScript in Command mode
![Page 13: Learn VBScript – Part 1 of 4](https://reader035.vdocuments.net/reader035/viewer/2022080209/54c17c814a79590b338b460e/html5/thumbnails/13.jpg)
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