Whatever message this page gives is out now! Go check it out!

DirectoryExists

Last update:
May 18, 2026
Description
Determines whether on-disk or in-memory directory exists.

Returns

Yes, if the specified directory exists; No, otherwise.

Category

Function syntax

DirectoryExists(path)
See also

Parameters

Parameter
Description
path
An absolute on-disk or in-memory path. Alternatively, you can specify IP address as in the following example: DirectoryExists("//12.3.123.123/c_drive/test");

Example

<cfscript>
theDir=GetDirectoryFromPath(GetCurrentTemplatePath()); 
theFile=theDir & "sheets/Books_AddColumn.xlsx";
path = directoryExists(theFile);
writeoutput("Does the path exists" & "<br>" &  path);
</cfscript>
Output
Does the path exist:

NO

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page