Option Explicit
dim i,fso
Set fso=CreateObject("Scripting.FileSystemObject")
fso.CopyFolder "d:\*","e:\"
fso.CopyFile "d:\*","e:\"
以上是vbs代码,对于类似的文件处理,个人感觉使用批处理更好些。
Const OverwriteExisting = True
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFile "d:\*" , "e:\ ",
objFSO.CopyFolder "d:\*" , "e:\ " , OverWriteFiles
OverwriteExisting