Results 1 to 4 of 4

Thread: Read Only

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Ireland, Dublin
    Posts
    76

    Talking

    Hi

    Does anyone know how to change a files properties. I need to change the read-only property on a file.

    Cheers

    IJ
    ---------------------------------
    TopMan
    ---------------------------------

  2. #2
    Hyperactive Member WP's Avatar
    Join Date
    Aug 2000
    Location
    Belgium
    Posts
    278

    Thumbs up

    Maybe this will help

    Code:
    Private Declare Function SetFileAttributes Lib "kernel32" Alias "SetFileAttributesA" (ByVal lpFileName As String, ByVal dwFileAttributes As Long) As Long
    
    Private Const FILE_ATTRIBUTE_NORMAL = &H80
    
    Private Sub Form_Load()
    
    Dim Tmp As Long
    Tmp = SetFileAttributes("c:\FILENAME", FILE_ATTRIBUTE_NORMAL)
    
    End Sub
    there are some others attributes you can set too look in the MSDN - SetFileAttributes

    WP

    Visual Basic 6.0 EE SP5 / .Net
    Windows XP

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Ireland, Dublin
    Posts
    76

    Talking

    Brilliant,

    Appreciate it.

    IJ
    ---------------------------------
    TopMan
    ---------------------------------

  4. #4
    Hyperactive Member WP's Avatar
    Join Date
    Aug 2000
    Location
    Belgium
    Posts
    278

    Wink

    ;-)

    Visual Basic 6.0 EE SP5 / .Net
    Windows XP

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