Full width home advertisement

Post Page Advertisement [Top]

To set attribute use this:

  1. Private Declare Function SetFileAttributes Lib "kernel32" Alias _
  2. "SetFileAttributesA" (ByVal lpFileName As String,_
  3. ByVal dwFileAttributes As Long) As Long
  4.  
  5. Private Sub cmd_Click()
  6. SetFileAttributes "c:\a.txt", vbArchive
  7. 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

Bottom Ad [Post Page]

| Designed by Colorlib