March 28, 2002

Get Read Only files (VB6.0)

VERSION 5.00
Begin VB.Form Form1
BorderStyle = 1 'Fixed Single
Caption = "Form1"
ClientHeight = 6615
ClientLeft = 45
ClientTop = 330
ClientWidth = 10095
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 6615
ScaleWidth = 10095
StartUpPosition = 3 'Windows Default
Begin VB.ListBox List1
Height = 5325
Left = 3300
OLEDragMode = 1 'Automatic
TabIndex = 4
Top = 90
Width = 6435
End
Begin VB.DirListBox Dir1
Height = 5715
Left = 180
TabIndex = 2
Top = 480
Width = 3015
End
Begin VB.DriveListBox Drive1
Height = 315
Left = 180
TabIndex = 1
Top = 120
Width = 2985
End
Begin VB.CommandButton Command1
Caption = "Find Read files"
Height = 525
Left = 3660
TabIndex = 0
Top = 5670
Width = 1245
End
Begin VB.FileListBox File1
Height = 2040
Left = 150
TabIndex = 3
Top = 2700
Visible = 0 'False
Width = 2445
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub Command1_Click()

SetClearArchiveBit "C:\WINNT\Profiles\amungale.000\Desktop\ImplMysClient33.txt"

End Sub

Sub SetClearArchiveBit(filespec)

Dim oFS, oFile
Set oFS = CreateObject("Scripting.FileSystemObject")

List1.Clear

For i = 0 To File1.ListCount - 1
Set oFile = oFS.GetFile(File1.Path & "\" & File1.List(i))
If oFile.Attributes And ReadOnly Then
'List1.AddItem File1.List(i)
Else
List1.AddItem File1.Path & "\" & File1.List(i)
End If
Next
End Sub


Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub


Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub