Preferences

What happened to VBScript? It feels like a kind of BeOS or Amiga within the scripting-on-Windows domain. It's just... disappeared, and tends to either fulfill "it MUST run EVERYWHERE" OCD-backward-compatibility requirements - basically Win32 Perl - or it's used for viruses.

Outside highly narrow application/context-specific situations, that is.


> What happened to VBScript?

Nothing.

  Microsoft Windows [Version 10.0.17134.285]
  (c) 2018 Microsoft Corporation. All rights reserved.

  C:\Windows\SysWOW64>cscript
  Microsoft (R) Windows Script Host Version 5.812
  Copyright (C) Microsoft Corporation. All rights reserved.

  Usage: CScript scriptname.extension [option...] [arguments...]

  Options:
   //B         Batch mode: Suppresses script errors and prompts from displaying
   //D         Enable Active Debugging
   //E:engine  Use engine for executing script
   //H:CScript Changes the default script host to CScript.exe
   //H:WScript Changes the default script host to WScript.exe (default)
   //I         Interactive mode (default, opposite of //B)
   //Job:xxxx  Execute a WSF job
   //Logo      Display logo (default)
   //Nologo    Prevent logo display: No banner will be shown at execution time
   //S         Save current command line options for this user
   //T:nn      Time out in seconds:  Maximum time a script is permitted to run
   //X         Execute script in debugger
   //U         Use Unicode for redirected I/O from the console
Internet Explorer also still supports it. You can write a full, albeit basic, application in a text file, rename it as 'whatever.hta' and run it by double clicking on it. It launches in its own window using the IE html control as its form. The MSDN pages have a clone of Notepad.exe as a vbscript .hta as an example.

In some ways it's like the grandparent of Electron or React apps, just a decade too early.

The last .hta I wrote was several years ago - a [mostly] complete clone of 'Active Directory Users & Computers' that anyone could use.

To expand, it's still there and used, though Microsoft has pushed Powershell scripts in its place.
VBScript and JScript were very much tied to COM, as was the document object model in Internet Explorer, where these scripting implementations were used, up until version 6/7.

What happened was that Internet Explorer moved towards a more standards-compliant JavaScript implementation, leaving the kind-of-ES3-compliant JScript behind, while at the same time COM was being generally deemphasized in favor of .NET.

It's still there, but its usefulness is limited by several things:

* It can only make use of libraries that expose dynamically bound COM objects. No C libraries (so no win32 API) and no .NET.

* Even then, it can't subscribe to COM events, as far as I can tell. (There is some weird mechanism with some external XML file in certain contexts.)

* As for JScript, I haven't found any transpilers that target ECMAScript 3, so it would be difficult to use modern libraries with it. (And it would probably be slow anyway.)

This item has no comments currently.

Keyboard Shortcuts

Story Lists

j
Next story
k
Previous story
Shift+j
Last story
Shift+k
First story
o Enter
Go to story URL
c
Go to comments
u
Go to author

Navigation

Shift+t
Go to top stories
Shift+n
Go to new stories
Shift+b
Go to best stories
Shift+a
Go to Ask HN
Shift+s
Go to Show HN

Miscellaneous

?
Show this modal