Listing 3: VBScript Code That Aborts a Script When It's Not Running Under Cscript.exe

If ScriptHost() <> "cscript.exe" Then
  WScript.Echo "You must run this script with the CScript host."
  WScript.Quit 1
End If