Function Reference


_WinAPI_ShellOpenFolderAndSelectItems

Opens a Windows Explorer window with specified items in a particular folder selected

#include <WinAPIShellEx.au3>
_WinAPI_ShellOpenFolderAndSelectItems ( $sFilePath [, $aNames = 0 [, $iStart = 0 [, $iEnd = -1 [, $iFlags = 0]]]] )

Parameters

$sFilePath The fully qualified path that specifies the folder or file. If $aNames parameter is used, $sFilePath should
specified only to a folder, otherwise, the function fails. This parameter can be an empty string.
$aNames [optional] The array of the folder or file names to be selected. It should be just names in the specified
folder, without its path.
$iStart [optional] The index of array to start selecting at.
$iEnd [optional] The index of array to stop selecting at.
$iFlags [optional] The optional flags. This parameter can be one or more of the following values.

Windows Vista or later
$OFASI_EDIT
$OFASI_OPENDESKTOP

Return Value

Success: 1.
Failure: 0 and sets the @error flag to non-zero, @extended flag may contain the HRESULT error code.

See Also

Search SHOpenFolderAndSelectItems in MSDN Library.

Example

#include <File.au3>
#include <WinAPIShellEx.au3>

; X64 running support
Local $sWow64 = ""
If @AutoItX64 Then $sWow64 = "\Wow6432Node"

Local $sPath = RegRead('HKLM\SOFTWARE' & $sWow64 & '\AutoIt v3\AutoIt', 'InstallDir')

Local $aList = _FileListToArray($sPath, '*.exe', 1)

If IsArray($aList) Then
    _WinAPI_ShellOpenFolderAndSelectItems($sPath, $aList, 1)
EndIf