Function Reference
_FO_IsDir
Checks, whether is the folder
#Include <FileOperations.au3>
_FO_IsDir ( $sTmp )
Parameters
$sTmp | The path to the file or directory |
Return Value
Success: | Returns True |
Failure: | Returns False. If @error is not equal to 0, it means that the object does not exist. |
Remarks
With this function you can determine whether the object is a file (False), but @error should be 0.Example
; AZJIO
; http://www.autoitscript.com/forum/topic/133224-filesearch-foldersearch/
#include <FileOperations.au3>
$sTmp = _FO_IsDir('C:\WINDOWS')
; $sTmp = _FO_IsDir('C:\Boot.ini')
; $sTmp = _FO_IsDir('Folder')
If Not (@error Or $sTmp) Then ; True if @error = 0 and $sTmp = 0
MsgBox(0, ';)', 'This is the file')
ElseIf $sTmp Then
MsgBox(0, ';)', 'This is the folder')
Else
MsgBox(0, ';)', 'Error')
EndIf