Bill
Fri Jul 04 11:20:49 CDT 2003
This came right out of the Windows script docs:
http://msdn.microsoft.com/scripting
Except I changed it for the Readonly bit
You'ld probably want to change it to
pass it a folder instead then toggle all
the files in the folder.
Function ToggleReadOnlyBit(filespec)
Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFile(filespec)
If f.attributes and 1 Then
f.attributes = f.attributes - 1
ToggleReadOnlyBit= "ReadOnly bit is cleared."
Else
f.attributes = f.attributes + 1
ToggleReadOnlyBit= "ReadOnly bit is set."
End If
End Function
Bill Wallace
"Bioman" <azeem.mohammed@biovail.com> wrote in message
news:ca96a5fd.0307030811.3c6bbab3@posting.google.com...
> Hello, I need to copy a folder and all it's files to a new location
> for backup. How do I change the attributes of the destination
> read-only files so I can overwrite them for the copy and then reset
> the attribute after the copy?
>
> Anyone?
>
> Thanks.