FolderExists Method

 

Description

 

Returns True if the specified folder exists; False if it does not.

 

PowerBASIC Syntax

 

METHOD FolderExists ( _

BYVAL bstrFolderSpec AS STRING _

) AS INTEGER

 

Arguments

 

bstrFolderSpec

BSTR. The name of the folder whose existence is to be determined. A complete path specification (either absolute or relative) must be provided if the folder isn't expected to exist in the current folder.

 

Return Value

 

Boolean. VARIANT_TRUE or VARIANT_FALSE.

 

Example [PowerBASIC]

 

#INCLUDE "windows.inc"

#INCLUDE "scrrun.inc"

 

DIM fso AS IFileSystem

DIM iExists AS INTEGER

 

' Create an instance of the FileSystemObject

fso = NEWCOM "Scripting.FileSystemObject"

' Check if the folder exists

iExists = fso.FolderExists(UCODE$("C:\MyFolder"))

 

Valid XHTML 1.0 Transitional