ASP MoveMethods


File 对象参考手册Complete File Object Reference

The Move method moves a specified file or folder from one location to another.

Note:The result of applying the Move method to a File or Folder is exactly the same as performing the operation with FileSystemObject.MoveFile or FileSystemObject.MoveFolder. However, note that the FileSystemObject.MoveFile or FileSystemObject.MoveFolder methods can move multiple files or folders.

Syntax

FileObject.Move(destination)

FolderObject.Move(destination)

Parameters Description
destination Required. The destination where the file or folder is to be moved. Wildcards are not allowed.

Example for the File Object

<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
Set f=fs.GetFile("c:\test.txt")
f.Move("c:\test\test.txt")
set f=nothing
set fs=nothing
%>

Example for the Folder Object

<%
dim fs,fo
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fo=fs.GetFolder("c:\test")
fo.Move("c:\asp\test")
set fo=nothing
set fs=nothing
%>


File 对象参考手册Complete File Object Reference Other Extensions