sOperation | (String) Type of the operation with the file. If the parameter is empty string, then the "open" value is set.
"print" - The file has to be printed
|
---|---|
sFile | (String) The file name with the path.
If a full path is not entered, then it is completed relative to the application folder. It is recommended to use the PROMOTIC path syntax - see PROMOTIC path to files or folders. |
sParameters | (String) Parameters that have to be passed to the application associated to the running file |
sFolder | (String) Path to the working folder of the application.
It is recommended to use the PROMOTIC path syntax - see PROMOTIC path to files or folders. |
vOptions | (Variant) Additional parameters
KeyVal - Additional parameters entered as a string. Entries are in the KeyVal format, for example "state:hidden;timeout:10;"
state - Specifies the application display mode.
normal (default) - normal active
max - maximized active
min - minimized active
hidden - hidden
normal_na - normal not active
min_na - minimized not active timeout - Specifies the maximum time for the operation in seconds. Default is -1, meaning unlimited timeout.
If the operation is not completed within the specified time, then the onComplete(ev) function is called, where the return value (the ev.Value parameter) will be undefined (invalid). Number - The old way of specifying the display mode of the application using a number:
0 - hidden
1 - normal active
2 - minimized active
3 - maximized active
4 - normal not active
6 - minimized not active |
sRequestId | [optional] (String) Identifier of registered event function.
- Prevents duplicate registering of the same function.
- May contain any characters (this is not a system name).
- Must not be an empty string. |
onComplete | [optional] (Function) The parameter onComplete contains a function that will be called for asynchronous handover of the result. The function must be in syntax: function onComplete(ev) {};
where the parameter ev.Value contains the returned value (result) of the asynchronous calling. The result is the value returned by the running application on its termination. If no error occurred, then this value is usually 0. If the application was not terminated within the timeout specified by the timeout parameter, then the return value is undefined. |
Pm.ShellExecute("print", "#app:experiment.htm", "", "#app:", 0);
Pm.ShellExecute("", "\\\\SERVER\\PRINTER1", "", "", 0);
Pm.ShellExecute("open", "C:\\PowerPoint\\presentation.pps", "", "C:\\PowerPoint\\", 1);
var sPathBrowser = "c:/Program Files (x86)/Microsoft/Edge/Application/";
Pm.ShellExecute("open", sPathBrowser + "msedge.exe", "c:/download/filename.pdf", sPathBrowser, 3);
var sUser = "ftpname:ftppassword";
var sFtpFile = "ftp://ftpservername.com/dir/filename.pdf";
var sLocalFile = "c:/Test/filename.pdf";
var sSend = ' -T "' + sLocalFile + '" -u "' + sUser + '" --url "' + sFtpFile + '"';
Pm.ShellExecute("open", "c:/Windows/System32/curl.exe", sSend, "", "state:hidden;", pMe.GetPathName(), onComplete);
function onComplete(ev)
{
if (!ev.Value)
{
Pm.Debug("FTP transfer is OK");
}
}