<%
Private Sub SetAttr(byVal pathname, byVal attributes)
Dim objFSO, objFile, objFolder, boolErr, strErrDesc
On Error Resume Next
Set objFSO = Server.CreateObject("scripting.filesystemobject")
if instr( right( pathname, 4 ), "." ) then
' probably a file
Set objFile = objFSO.GetFile(pathname)
objFile.Attributes = attributes
Set objFile = Nothing
else
' probably a directory or folder
Set objFolder = objFSO.GetFolder(pathname)
objFolder.Attributes = attributes
Set objFolder = Nothing
end if
if Err Then
boolErr = True
strErrDesc = Err.Description
end if
Set objFSO = Nothing
On Error GoTo 0
if boolErr then Err.Raise 5103, "SetAttr Statement", strErrDesc
End Sub
%>