CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Is it read only

  1. #1
    Join Date
    Oct 1999
    Location
    US
    Posts
    34

    Is it read only

    How can I figure if a file has a read only property checked?
    Thank you!
    Alex!


  2. #2
    Join Date
    Jan 2000
    Location
    MO, USA
    Posts
    1,506

    Re: Is it read only

    set a reference to the Microsoft Scripting Runtime and use code similar to this:

    Dim fso as Scripting.FileSystemObject
    Dim ofile as Scripting.File

    set fso = new Scripting.FileSystemObject
    set ofile = fso.GetFile("C:\yourfile.txt")
    MsgBox ofile.Attributes = ReadOnly

    set ofile = nothing
    set FSO = nothing





    Hope this helps,
    John

    John Pirkey
    MCSD
    www.ShallowWaterSystems.com
    John Pirkey
    MCSD (VB6)
    http://www.stlvbug.org

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured