The code copy is as follows:
<%
FunctionCopyMyFolder(FolderName,FolderPath)
sFolder=server.mappath(FolderName)
oFolder=server.mappath(FolderPath)
setfso=server.createobject("scripting.filesystemobject")
iffso.folderexists(server.mappath(FolderName)) Then'Check if the original folder exists
iffso.folderexists(server.mappath(FolderPath)) Then'Check if the target folder exists
fso.copyfoldersFolder,oFolder
Else'Destination folder is created if it does not exist
CreateNewFolder=Server.Mappath(FolderPath)
fso.CreateFolder(CreateNewFolder)
fso.copyfoldersFolder,oFolder
Endif
CopyMyFolder="Copy the folder ["&server.mappath(FolderName)&"] to ["&server.mappath(FolderPath)&"] successfully!"
Else
CopyMyFolder="Error, the original folder ["&sFolde&"] does not exist!"
EndIf
setfso=nothing
EndFunction
FolderName="2006"'Original folder
FolderPath="2008"'Destination folder
response.write"&CopyMyFolder(FolderName,FolderPath)&""'Copy all contents in folder 2006 to folder 2008 and return the result
%>