[This is preliminary documentation and subject to change]

### CopyHere

The ADSI container object CopyHere method copies an object into a container.

###### Syntax

Set CopiedObj = Object.CopyHere(SourceName, NewName)

###### Parts

CopiedObj
  Accesses the copied object in the container.
object
  Contains an IIS Admin Object, usually as a result of a previous GetObject operation.
SourceName
  The name of the object to be copied.
NewName
  The new name for the copied object.

###### Remarks

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.

###### Code Example

    <%
      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")
      ToVdirObj.SetInfo
    %>

###### See Also

GetObject, Create, Create, MoveHere

© 1997-2001 Microsoft Corporation. All rights reserved.