Visual Basic 6 function "is_dir"

Go back

Below you'll find the source for the Visual Basic 6 function is_dir.

Attribute VB_Name = "modIsDir"
' This function is downloaded from:
' You may freely distribute this file but please leave all comments, including this one, in it.
' @Author Stefan Thoolen <>

' Tells whether the filename is a directory
' Same syntax as the PHP function 'is_dir'
' See also:
' Dependency: Scripting.FileSystemObject (.NET Framework 2.0)
' @param    String  filename        The dir/filename to check
' @return   Boolean                 True if it's a folder, false if it's not
' @author   Stefan Thoolen <>
Public Function is_dir(filename As String) As Boolean
    Dim fso As Object
    Set fso = CreateObject("Scripting.FileSystemObject")
    is_dir = fso.FolderExists(filename)
    Set fso = Nothing
End Function