The ADSI container object CopyHere method copies an object into a container.
Set CopiedObj = Object.CopyHere(SourceName, NewName)
The CopiedObj variable receives a pointer to the object itself, which remains in the container.
When the contained object to be copied is part of an application, the CopyHere method will remove the application definition before copying the object. See the AppDelete method of the IIsWebVirtualDir and IIsWebDirectory objects.
<%
Dim ToVDirObj, FromVDirObj, RootVDirObj
'Get the root virtual directory object for a server.
Set RootVDirObj = GetObject("IIS://LocalHost/W3SVC/4/ROOT")
'Copy a virtual directory object.
'Also get a pointer to the new object.
Set ToVdirObj = RootVDirObj.CopyHere("VDir1", "VDir2")
RootVDirObj.SetInfo
%>
GetObject, Create, Delete, MoveHere