.. highlightlang:: us .. index:: ShellExecute .. _shellexecute: ShellExecute ============ .. us.tag ShellExecute NOTREADYENGLISH Programming.os New310 Changed5403 :ref:`ShellExecute` opens a file with a program which is registered for the file type. .. function:: nErrorCode = ShellExecute(ssFile) nErrorCode = ShellExecute(ssFile, ssParams) nErrorCode = ShellExecute(ssFile, ssParams, ssOperation) nErrorCode = ShellExecute(ssFile, ssParams, ssOperation, ssDir) nErrorCode = ShellExecute(ssFile, ssParams, ssOperation, ssDir, nShow) .. us.return **Return Value** If *nErrorCode* is greater than 32 the function was successfully otherwise an error occurred. .. us.params **Parameters** .. uparam:: ssFile *ssFile* is the complete file name. .. uparam:: ssParams String that specifies the parameters to be passed to the application. .. uparam:: ssOperation Specifies the action to be performed. Default value ist ``open``. Other Operations: ``explore``, ``find``, ``print``. .. uparam:: ssDir String that specifies the default (working) directory for the action. .. uparam:: nShow The flags that specify how an application is to be displayed when it is opened. Possible values: ``SW_HIDE``, ``SW_SHOWNORMAL``, ``SW_NORMAL``, ``SW_SHOWMINIMIZED``, ``SW_SHOWMAXIMIZED``, ``SW_MAXIMIZE``, ``SW_SHOWNOACTIVATE``, ``SW_SHOW``, ``SW_MINIMIZE``, ``SW_SHOWMINNOACTIVE``, ``SW_SHOWNA``, ``SW_RESTORE``, ``SW_SHOWDEFAULT``, ``SW_FORCEMINIMIZE``, ``SW_MAX``. Default value is ``SW_SHOW``. .. us.example **Example** :: ShellExecute("d:\\test.xls"); // Opens the Windows Explorer ShellExecute("c:\\program files"); // Opens notepad ShellExecute("notepad", "d:\\text.txt"); .. us.history **History** .. list-table:: :header-rows: 1 * - Version - Description * - R2012.3 (5.40.3) - New parameters 2 to 5. .. seealso:: :ref:`overview-programming`, :ref:`system` :sub:`id-329545`