MoveHere

The ADSI container object MoveHere method moves an object into a container and removes the object from its origin.

Syntax

Set MovedObj = Object.MoveHere(SourceName, NewName)
 

Parts

MovedObj
Accesses the object moved into the container.
object
The IIS Admin Object that contains the object. Usually the result of a previous GetObject operation.
SourceName
The name of the object to be moved.
NewName
The name for the moved object.

Remarks

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.

Code Example

<% 
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 
%> 
 

See Also

GetObject, Create, Delete, CopyHere