The ADSI container object MoveHere method moves an object into a container and removes the object from its origin.
Set MovedObj = Object.MoveHere(SourceName, NewName)
The MovedObj variable receives a pointer to the object itself, which remains in the container.
The MoveHere method is equivalent to CopyHere followed by Delete.
When the contained object to be moved is part of an application, the MoveHere method will disable the application definition before moving the object. See the AppDisable 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/3/ROOT")
' Get the object to be moved
Set FromVDirObj = GetObject("IIS://LocalHost/W3SVC/3/ROOT/VDir1")
' Move the object and give it a new name
Set ToVdirObj = RootVDirObj.MoveHere("VDir1", "VDir2")
' Release the source object because it has been deleted
Set FromVDirObj = nothing
%>
GetObject, Create, Delete, CopyHere