JScript

From TheAlmightyGuru
Jump to: navigation, search

JScript is a scripting language created by Microsoft as a custom implementation of JavaScript. It is executed in Windows by the Windows Scripting Host using Microsoft OLE Automation along with VBScript. It was first released for use with Internet Explorer 3.0 in August 1996, and has been included with every desktop version of Windows since Windows 98. It was last updated on 2011-03-14 with the release of Internet Explorer 9.0. Microsoft appears to have silently discontinued the language in favor of JScript .NET, but JScript .NET is hardly a replacement as it must be compiled before using. Unlike JavaScript, JScript only works with Microsoft Windows, so it's not useful for cross-platform design.

I first learned about JScript in the mid-2000s because I often accessed the Windows Scripting Host to have access to some functions not available in the language I was working in at the time. Later, I found that you could write and execute standalone .js and .vbs files in JScript and VBScript. Since then, I have used JScript to write various scripts to automate processes in Windows including running programs that support command line access, accessing the ImageMagick ActiveX, and performing instructions more complex than those supported by Windows batch files. Examples of each of these implementations can be seen in the example scripts I have on this site.

Scripts

Documentation

This is the latest help documentation for Windows Scripting which implements JScript. Microsoft's latest version is 5.7, but, as far as I know, the last help documentation they released was for version 5.6.

Basic Operations

Message Box

var shell = new ActiveXObject("WScript.Shell");
shell.Popup("Hello World.");

Links