Quantcast
Channel: Clint Boessen's Blog
Viewing all articles
Browse latest Browse all 343

VB Script - Remove Files from being Read Only

$
0
0
The below VB Code uses scripting.filesystemobject to go through a bunch of files and remove the read only parameter.  I found it quite handy for a scheduled task when dealing with a rouge application.

Dim fl As File
If fso.FileExists(FileName) Then
    Set fl = fso.GetFile(FileName)
    If (fl.Attributes And ReadOnly) Then
      fl.Attributes = fl.Attributes - ReadOnly
    End If
End If

Hope this code snippet helps someone else!

Viewing all articles
Browse latest Browse all 343

Trending Articles