run()

Executes an external program or opens a file with an optional parameter.

Syntax

run(filepath)
run(filepath, parameters)

Parameters

Parameter Type Description
filepath String The path to the executable or file to open.
parameters String (Optional) Command-line arguments or parameters to pass. optional

Return Value

Examples

Run notepad.exe

run("notepad.exe");

Shutdown Windows

run("shutdown.exe", "-s -t 0");

Open a text file

run("C:/documents/note.txt");