ASP中移动复制文件的代码

ASP中移动复制文件是不是通过FSO来实现的,小弟从网上转载了一段代码,但是运行起来报错,请大家帮忙看看哪里的问题。虽然ASP淘汰了,不过公司网站就是这个,要用ASP没办法啊。

1、用File对象:

Set fso=Server.CreateObject(“Scripting.FileSystemObject”)
Set f1=fso.GetFile(“d:\wwwroot\1.txt”)
f1.move(“d:\wwwroot\new1\1.txt”)
f1.copy(“d:\wwwroot\new2\1.txt”)
f1.delete
f1.close 'http://www.zhaomu.com 转载

2、用FSO对象:

Set fso=Server.CreateObject(“Scripting.FileSystemObject”)
a=fso.MoveFile(“d:\wwwroot\1.txt”,”d:\wwwroot\new1\1.txt”)
b=fso.CopyFile(“d:\wwwroot\1.txt”,”d:\wwwroot\new2\1.txt”)
c=fso.DeleteFile(“d:\wwwroot\1.txt”)

[code="asp"]<%
Function CopyMyFolder(FolderName,FolderPath)
sFolder=server.mappath(FolderName)
oFolder=server.mappath(FolderPath)
set fso=server.createobject("scripting.filesystemobject")
if fso.folderexists(server.mappath(FolderName)) Then'检查原文件夹是否存在
if fso.folderexists(server.mappath(FolderPath)) Then'检查目标文件夹是否存在
fso.copyfolder sFolder,oFolder
Else '目标文件夹如果不存在就创建
CreateNewFolder = Server.Mappath(FolderPath)
fso.CreateFolder(CreateNewFolder)
fso.copyfolder sFolder,oFolder
End if
CopyMyFolder="复制文件夹["&server.mappath(FolderName)&"]到["&server.mappath(FolderPath)&"]成功!"
Else
CopyMyFolder="错误,原文件夹["&sFolde&"]不存在!"
End If
set fso=nothing
End Function
FolderName="原文件夹"
FolderPath="目标文件夹"
response.write""&CopyMyFolder(FolderName,FolderPath)&""
%>[/code]

什么错误?d:\wwwroot\1.txt 有这个文件吗?