Renames given directory. NOTE:Ensure that you have the required permissions to run this function.

directoryRename(oldPath, newPath) → returns void

Argument Reference

oldPath string

Absolute path of the directory to be renamed. Alternatively, you can specify IP address, for example, DirectoryRename("//");

newPath string

New name for the directory.

createPath boolean
Default: true

Lucee Only. If set to false, expects all parent directories to exist. true will generate necessary directories.

Sample code invoking the directoryRename function

<cfset renameDirectory = "someDirPath" />
<cfset rename = "newName" />
<cfset directoryRename(renameDirectory,newName)>

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub