การคัดลอกรหัสมีดังนี้:
Tempsource, Tempend ต้องใช้เส้นทางที่สมบูรณ์
rootPath = request.ServerVariables ("APPL_PHYSICAL_PATH") 'รับเส้นทางที่แน่นอนของโปรแกรมปัจจุบัน
FunctionCopyFiles (Tempsource, Tempend)
dimfso
setfso = server.createObject ("Scripting.FilesYstemObject")
iffso.fileexists (tempend) จากนั้น
Response.write "ไฟล์สำรองเป้าหมาย <b>" & tempend & "</b> มีอยู่แล้วโปรดลบออกก่อน!"
setfso = ไม่มีอะไร
exitfunction
endif
iffso.fileexists (tempsource) จากนั้น
อื่น
Response.write "ไฟล์ฐานข้อมูลต้นฉบับที่จะคัดลอก <b>" & tempsource & "</b> ไม่มีอยู่!"
setfso = ไม่มีอะไร
exitfunction
endif
fso.copyfileTempsource, tempend
Response.write "ได้คัดลอกไฟล์ <b>" & tempsource & "</b> ไป <b>" & tempend & "</b>"
setfso = ไม่มีอะไร
endfunction