ShellExecute Commands

Custom Commands support the “ShellExecute” function, which lets you tell the Windows shell to perform an operation on a specified file. The nice thing about ShellExecute is that you don’t need to know what specific application is registered to handle a particular type of file. For technical background information, see the “ShellExecute” function in the Windows Shell API documentation.

To use this feature, the Run string in the custom command needs to start with “ShellExecute”. The format should be:

ShellExecute <verb> <filespec> <optional parameters>

For example, to browse a website:

ShellExecute open

The verb is a single word, which can be one of the following:

edit Opens an editor for the file.

explore The function explores the folder specified.

open The function opens the file specified. The file can be an executable file or a document file. It can also be a folder.

print The function prints the document file specified. If filespec is not a document file, the function will fail.

properties Displays the file or folder's properties.

find Launches the Find Files application found on the Start menu.

"" (empty string) to skip this parameter to ShellExecute.

The filespec parameter can be any valid path. Use double quotes around complex path names with embedded spaces. You can also use a meta-character, such as %f (for the current file). It can also be the name of an executable file.

The optional parameters list is anything to the right of the filespec. It specifies the parameters to be passed to the application that ultimately runs. The format is determined by the verb that is to be invoked, and the application that runs. You can use custom command meta-characters here as well.

The working directory text box of the custom command is applied before the ShellExecute is invoked. However, output cannot be captured or parsed when using ShellExecute.