Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

ASP CopyFolder Method

ASP CopyFolder Method


FileSystemObject Reference Complete FileSystemObject object reference manual


The CopyFolder method copies one or more folders from one location to another.

Syntax

FileSystemObject.CopyFolder source,destination[,overwrite]

Parameters Description
source Required. The folder(s) to copy (wildcards can be used).
destination Required. The destination for the copied folder(s) (wildcards cannot be used).
overwrite Optional. A Boolean value specifying whether existing folders can be overwritten. True allows overwriting existing folders; False prevents existing folders from being overwritten. The default is True.

Example

<%

'Copy all folders in c:\mydocuments\web to the folder c:\webpages

dim fs

set fs=Server.CreateObject("Scripting.FileSystemObject")

fs.CopyFolder "c:\mydocuments\web*","c:\webpages"

set fs=nothing

%>

<%

'Copy only the folder test from c:\mydocuments\web to the folder c:\webpages

dim fs

set fs=Server.CreateObject("Scripting.FileSystemObject")

fs.CopyFolder "c:\mydocuments\web\test","c:\webpages"

set fs=nothing

%>


FileSystemObject Reference Complete FileSystemObject object reference manual