pui.runPCCommand()



This function allows you to run any command against the local PC's command interpreter. You can use this to launch PC-side programs.

The "command" parameter is a JavaScript string containing the command to run.

Any standard windows environment variables can be built right into the command string. The applet will resolve them to their actual values before the command is run.

Please note that the backslash character commonly used in Windows paths is used as the beginning of an escape sequence in JavaScript. For this reason, include 2 of the characters for each 1 you want to represent in your command string, as shown in the first example below.

If for some reason the command cannot be executed successfully, an error message will be displayed in the browser using an alert box. This might happen, for example, if the program you are trying to run is not installed on the local PC.

Examples:

var command = "%PROGRAMFILES%\\Vendor XYX\\XYZImagingProgram.exe"; pui.runPCCommand(command); // this will run XYZImagingProgram.exe // Or... // This is another way to do the same thing, it's the same function... runPCCommand(command);



pui.runPCCommand("notepad.exe"); // this will open up an empty notepad document // Or... // This is another way to do the same thing, it's the same function... runPCCommand("notepad.exe");



pui.runPCCommand("calc.exe"); // this will run the system's calculator // Or... // This is another way to do the same thing, it's the same function... runPCCommand("calc.exe");