the source: Dim fso As New FileSystemObject Public Sub allfilelock(path As String) Dim f As Folder, fc As Folders, f1 As Folder Dim fil As Files Set f = fso.GetFolder(path) Set fc = f.SubFolders If fc.Count = 0 Then Exit Sub End If For Each f1 In fc Set fil = f1.Files If fil.Count <> 0 Then SetAttr f1.path, vbHidden + vbSystem End If allfilelock (f1.path) Next End Sub Public Sub allfileshow(path As String) Dim f As Folder, fc As Folders, f1 As Folder Dim fil As Files Set f = fso.GetFolder(path) Set fc = f.SubFolders If fc.Count = 0 Then Exit Sub End If For Each f1 In fc Set fil = f1.Files If fil.Count <> 0 Then SetAttr f1.path, vbArchive End If allfilelock (f1.path) Next End Sub Private Sub Form_Load() On Error GoTo errhandler errhandler: Select Case Err.Number Case 53: MsgBox (" File For Hidden Not Found ") Exit Sub End Select End Sub Private Sub LHCommand1_Click() allfilelock App.path End Sub Private Sub LHCommand2_Click() allfileshow App.path End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)