Tuesday, October 30, 2012

VB Script - Remove Files from being Read Only

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!

4 comments:

  1. Another great post, I appreciate all the work you put into this site, helping out others with your fun and creative works.paper writing

    ReplyDelete
  2. I was looking for any article for my school homework and finally got it from you. Thanks.C++ Homework Help

    ReplyDelete
  3. Thanks for the great tutorial. It is nice to go through the process at a high level. Accounting Assignment Help

    ReplyDelete
  4. Are you trying to make money from your websites by popunder ads?
    If so, did you ever use PopAds?

    ReplyDelete