Is VBScript or VBA Dead/Dying?
Is VBScript Still Relevant? Yes, if you are a windows programmer, it is still worth learning VBScript and it is quick to learn!
Depending on the Host Environment, the VBScript can run in the following environments: Windows Scripting Host (WSH), Internet Information Server (IIS), Microsoft Internet Explorer and Microsoft Office products (such as Excel).
VBScript, not to confuse with VB (Visual Basic), is a scripting language. VBScript may seem outdated, and the support for VBScript is discontinued, but it is still being used in many places. Windows administrators may find it easier to learn/write than Powershell scripts.
VBScript supports Object-Oriented programming. You can define classes and create their instances like this:
Class Boy Private m_Name Private Sub Class_Initialize Name = "" End Sub Public Sub Set_Name(Name) m_Name = Name End Sub Public Function Get_Name Get_Name = m_Name End Function End Class Set Jack = New Boy Jack.Set_Name("Jack") WScript.Echo Jack.Get_Name
VBScript in Windows Scripting Host (WSH)
On Windows Platforms, the Windows Scripting Host Environment is still the best place for VBScript, where VBScript is a handy, lightweight, powerful programming language/scripting language for daily administrative tasks.
VBScript with the CreateObject, is able to call unmanaged COM so that it is still a powerful tool (like a hammer) for many many tasks. It is still going to be shipped by the future OS in the forseeable future for many many years.
VersionThe VBScript version is 5.6 on Windows XP, 5.7 on Windows 7 and 5.8 (latest) on Windows 10. You can use the following VBScript code to show its version.
MsgBox ScriptEngineMajorVersion & "." & ScriptEngineMinorVersion
AvailabilityVBScript is available on Every Windows Versions since Windows 98 (for Win 95, you need to install mannually Windows Scripting Host). This is great as it comes with the OS (you don't need to download and install the compiler or IDE). You can just open notepad, type in VBScript code, save it as *.vbs file extension. Double click the VBScript file and the VBScript code will be interpreted. For example, open a notepad and type the following, which will compute the sum from 1 to 100 using a single for loop.
Dim S S = 0 For i = 1 to 100 S = S + i Next Msgbox "Sum from 1 to 100 = " & S
HTML ApplicationThe HTA (HTML Application) is an easy way to write desktop/client software/application using HTML, where you can include VBScript or JScript. Bascially, most HTML files can be renamed as *.hta and you'll be able to launch them as a stand-alone desktop application using the Microsoft HTML Application Host.
- Which is Faster? VBScript or JScript on WSH – A Performance Comparison using Sieve of Eratosthenes
- List Items in the My Computer Folder using VBScript (WSH)
- ScriptUnit - VBScript/JScript Unit Tests Runner
- How to List Memory Devices in VBScript?
- Area of the Shadow? – The Monte Carlo Solution in VBScript
- VBScript Typewriter Machine
- and More...
Recommended VBScript Tools
- Script32 - VBScript to Binary Executables
- Vbsedit Toolkit Extends VBScript
- ScriptUnit – VBScript/JScript Unit Tests Runner
Developer's Resources Download
- (1395 KB) scrdoc56en.exe : documentation for Version 5.6 of VBScript, JScript, Windows Scripting Host
- (659 KB) scripten.exe : updates to Version 5.6 of the Microsoft scripting engine
- (659 KB) vbscript.pdf : 330 page of VBScript section from script56.chm
- (348 KB) script-runtime.pdf : 176 page of Script Runtime Objects from script56.chm
- (637 KB) windows-script-host.pdf : 340 page of Windows Script Host (WSH) from script56.chm
- (215 KB) windows-script-components.pdf : 100 page of Windows Scripting Components from script56.chm
- (1320 KB) script56.chm : a complete CHM help file contains the above documents
VBScript in Server Side as ASPVBScript can be used in Server Side (IIS) scripting language e.g. most likely the scripting language used is VBScript in the URL that ends with *.asp. However, the websites that are developed using ASP (Active Server Page) are considered outdated and can generally be replaced by a much modern language or technology such as .NET, PHP or Java.
VBA in Microsoft OfficeThe VBA stands for Visual Basic for Application, which is mainly used in Microsoft Office products. VBA can be quite powerful in creating customized formulas or Macros. For example,
Dim Data(1 to 500) as String 'Copy all values in Data to worksheet range therange. Range("therange").Value = Application.WorksheetFunction.Transpose(Data)
Relevant VBA Posts
<script language="VBScript"> Msgbox "Only in IE!" </script>
Contact Mevia Web Email.
Donation helps the cost of the domain/server, and is very much appreciated.
Page Edited on Irregular Basis: 29/Jul/2016 12:01:29