To set attribute use this:
- Private Declare Function SetFileAttributes Lib "kernel32" Alias _
- "SetFileAttributesA" (ByVal lpFileName As String,_
- ByVal dwFileAttributes As Long) As Long
- Private Sub cmd_Click()
- SetFileAttributes "c:\a.txt", vbArchive
- End Sub
Where "c:\a.txt" is a filename, you can replace it by directory name or filename.
Instead of vbAchrive you use:
- vbHidden
- vbSystem
- vbReadOnly
or you can use combination of it.
Like:
setFileAttributes "c:\a.txt", vbHidden + vbSystem
No comments:
Post a Comment