You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
721 B
Plaintext

<%
Private Sub FileCopy(ByVal source, ByVal destination)
Dim objFSO, objToCopy, boolErr, strErrDesc
On Error Resume Next
Set objFSO = Server.CreateObject("scripting.filesystemobject")
If InStr( Right( source, 4 ), "." ) Then
' probably a file
Set objToCopy = objFSO.GetFile(source)
Else
' probably a directory or folder
Set objToCopy = objFSO.GetFolder(source)
End If
objToCopy.Copy destination
If Err Then
boolErr = True
strErrDesc = Err.description
End If
Set objToCopy = Nothing
Set objFSO = Nothing
On Error GoTo 0
If boolErr Then Err.Raise 5104, "FileCopy Statement", strErrDesc
End Sub
%>