PDA

Click to See Complete Forum and Search --> : Read Only


IrishJoker
Aug 30th, 2000, 09:05 AM
Hi

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

Cheers

IJ

WP
Aug 30th, 2000, 09:27 AM
Maybe this will help


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

IrishJoker
Aug 30th, 2000, 09:36 AM
Brilliant,

Appreciate it.

IJ

WP
Aug 30th, 2000, 11:08 AM
;-)