TempSource,TempEnd必須用絕對路徑 rootPath=Request.ServerVariables("APPL_PHYSICAL_PATH") ‘獲取當前程序絕對路徑 Function CopyFiles(TempSource,TempEnd) Dim FSO Set FSO = Server.CreateObject("Scripting.FileSystemObject") IF FSO.FileExists(TempEnd) then Response.Write "目標備份文件 b>" TempEnd "/b> 已存在,請先刪除!" Set FSO=Nothing Exit Function End IF IF FSO.FileExists(TempSource) Then Else Response.Write "要復制的源數(shù)據(jù)庫文件 b>"TempSource"/b> 不存在!" Set FSO=Nothing Exit Function End If FSO.CopyFile TempSource,TempEnd Response.Write "已經(jīng)成功復制文件 b>"TempSource"/b> 到 b>"TempEnd"/b>" Set FSO = Nothing End Function