LibreOffice: XSystemShellExecute Interface Reference

LibreOffice LibreOffice 26.2 SDK API Reference

Loading...
Searching...
No Matches
XSystemShellExecute Interface Referencepublished

Specifies an interface for executing a system command. More...

`import "XSystemShellExecute.idl";`

Inheritance diagram for XSystemShellExecute:

## Public Member Functions
void | execute ([in] string aCommand, [in] string aParameter, [in] long nFlags) raises ( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::system::SystemShellExecuteException )
| Executes an arbitrary system command.
Public Member Functions inherited from XInterface
any | queryInterface ([in] type aType)
| queries for a new interface to an existing UNO object.
void | acquire ()
| increases the reference counter by one.
void | release ()
| decreases the reference counter by one.

## Detailed Description

Specifies an interface for executing a system command.

## Member Function Documentation

## ◆ execute()

void execute | ( | [in] string | aCommand,
|  | [in] string | aParameter,
|  | [in] long | nFlags )
raises | ( | ::com::sun::star::lang::IllegalArgumentException,
|  | ::com::sun::star::system::SystemShellExecuteException ) |  |  |

Executes an arbitrary system command.

There are generally two modes of operation for this function:

With URIS_ONLY among the passed-in nFlags, the passed-in aCommand must be a URI that is opened in an "only do secure things, make sure not to execute potentially dangerous code" way (e.g., instead of running an arbitrary app, open a window showing the location of the app).

Without URIS_ONLY among the passed-in nFlags, the passed-in aCommand must be a system pathname of an executable to run.

Parameters

  aCommand | Specifies the command to execute. This may be an executable file or a document which is registered with an application on a specific platform, so that the platform knows what application to launch for that document. If the command specifies a path to an executable, etc, this has to be a system specific path.
  aParameter | Specifies a list of space separated parameters. The method does not validate the given parameters, but only passes it as a parameter to the specified command.
  nFlags | Specifies different flags to control the execution of this method, for example, avoid showing system error messages, in case of failures, etc.

Exceptions

  com::sun::star::lang::IllegalArgumentException | when the specified flags are wrong or exclude each other; also thrown, with an ArgumentPosition of 0, when nFlags contains URIS_ONLY and aCommand is not an absolute URI reference
  com::sun::star::system::SystemShellExecuteException | in the case of errors when trying to executed the specified command.

See also
  com::sun::star::system::SystemShellExecuteFlags

The documentation for this interface was generated from the following file:

- com/sun/star/system/XSystemShellExecute.idl