ÄúµÄλÖãºÑ°ÃÎÍøÊ×Ò³£¾±à³ÌÀÖÔ°£¾VBScript£¾VBScript


objects constants operators statements functions properties methods







METHOD:  FileSystemObject.MoveFolder

object.MoveFolder source, destination

This method lets us move one or more folders from one location ( the source) to another (destination). Wildcards can be used within the source string, providing it is the last component in the path, to enable the moving of multiple folders, but cannot be used in the destination string. Note that if the source does contain wildcards, or if the destination ends with a back-slash (path separator), it is automatically assumed that the destination is an existing folder and any matching folders are moved to it.

It is recommended that you use the FolderExists method when moving a folder - if a source folder doesn't exist you'll get an error. An error also occurs if the destination is a directory or an existing file.

Code:
<%
dim filesys
set filesys=CreateObject("Scripting.FileSystemObject")
If filesys.FolderExists("c:\sourcefolder\test\") Then
   filesys.MoveFolder "c:\sourcefolder\test\", "c:\destfolder\"
End If
%>