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! (It is old but that does not mean it is useless and should be abandoned!)
Depending on the Host Environment, the VBScript can run in the following environments: Windows Scripting Host (WSH), Internet Information Server (IIS), .NET (Known as VB.NET), 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.
You can use this Online VBScript Obfuscator to protect your VBScript source code easily.
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.
Perfect Couple: VBScript and COMCOM is an old Microsoft Technology. It has been invented since 1993. VBScript has been greatly enhanced by the capability to use COM. For example, the Microsoft Office and tons of other appliations are built on COM technology. You can create COM object easily and use the exported function APIs e.g.
Set objExcel = CreateObject("Excel.Application") objExcel.Visible = True Set ws = objExcel.Workbooks.Open("Some Excel File.xls")
COM is old technology but it is not dead/dying, nor is VBScript. Could you see how easy to create/use the COM object in the above Excel example? The system administrators do not require IDEs or compile the source code. They just need to open notepad.exe (or other text editors), type in a few lines of VBScript, save it as *.vbs, and double click to run the VBScript under Windows Scripting Host environment. It works just like a charm!
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
- How to Kill Multiple Processes (Tasks) by Name using VBScript?
- VBScript: How to Modify the Priority of a Running Process?
- and More...
Recommended VBScript Tools
- Script32 - VBScript to Binary Executables
- Vbsedit Toolkit Extends VBScript
- ScriptUnit – VBScript/JScript Unit Tests Runner
- Online VBScript Obfuscator
Other Posts of VBScript
VBScript Developer's Resources Download
- (8547 KB) advanced-vbs-ms.pdf: Advanced VBScript for Microsoft Windows Administrators
- (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.
VBScript as in VB.NETVB.NET is a programming language targeted for Microsoft .NET platforms. However, VB.NET as limited by syntax, is not as powerful as C#. Therefore, unless you are a beginner, it is not recommended you choose VB as your .NET programming language because C# simply does a better job.
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.