Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting started with VBScript

Status
Not open for further replies.

Tranman

Programmer
Sep 25, 2001
695
US
Hi,
This will sound dumb, but I've been using VB for about 10 years (since 2.0 release), but have never written a single line of VBScript. I have no idea where to start (can I instantiate objects/forms/create dll's/exe's/use ADO/ole animation/whatever?). Where do I find the interpreter?

Could someone tell me about the advantages/disadvantages of using VBScript. And, is there some sort of reference book that I could read to familiarize myself with what is possible/impossible in VBScript?

Any advice appreciated,
Tranman
 
Found in the FAQ section of this forum: faq329-3578

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
You need to consider that VBScript is a bit different from VB. It is not a stand-alone development language like VB, you can't really "make a VBScript program" as such.

In this way it is closer to VBA, in that it is always hosted in some other program.

That said, there are several common hosts:
[ul][li]WSH (wscript.exe, cscript.exe)[/li]
[li]Internet Explorer[/li]
[li]Active Server Pages[/li]
[li]Office Suite programs[/li]
[li]Third-party programs[/li]
[li]Your own programs (VB programs can host VBScript via the Script control)[/li][/ul]
Much of the power of VBScript (and for that matter JScript) comes from its ability to use Variant data and ActiveX servers. This is how Windows scripts get access to files, databases, TCP sockets, message queues, XML parsers, HTTP engines, WMI, and most user-interaction elements. It also lets these scripts automate appropriately-enabled applications like those in the Office Suite.

A good chunk of what a given piece of script can do depends on the object model offered to it by its host as well. A WSH script has access to those things provided to it by the "WScript object" while an IE script has access to the hosting web page's DOM, etc.

So, what VBScript is depends on how you approach it. Some people see it as a web technology, others see it as a replacement or alternative to .BAT/.CMD files, and still others view it as another way to create Office macros or automate Office forms. Still others use it to create whole applications! But they still need to do so within the context of a host.


So what is VBScript? Well... "What do you want to do today?" ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top