Olivier
Olivier

Reputation: 309

Start an application with JScript

Is there a way to start an application using JScript?

Upvotes: 6

Views: 7217

Answers (2)

Chris Fulstow
Chris Fulstow

Reputation: 41902

To launch an executable from Windows Scripting Host using JScript, create a file with the .js extension and add this code:

var shell = WScript.CreateObject("WScript.Shell");
shell.Run("calc.exe");

Double click the file's icon to execute and launch the application.

Upvotes: 1

You can use something like:

WSH = new ActiveXObject("WScript.Shell");
WSH.run("notepad.exe");

Upvotes: 4

Related Questions