Introduction
Most of us attached by the virus which adds
the hidden attribute to every folder on your system. However after cleaning your system, your folders are still hidden.
So, that tip eases the unhide process of yours folders
Using the code
The key of this tip is this line
File.SetAttributes("Dir", IO.FileAttributes.Normal)
The main part
Dim i As Long
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Timer1.Interval = 500
Timer1.Start()
Dim dirs() As String = Directory.GetLogicalDrives()
For Me.i = dirs.GetLowerBound(0) To dirs.GetUpperBound(0)
ComboBox1.Items.Add(dirs(i))
Next i
End Sub
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Try
For Each Dir As String In Directory.GetDirectories(ComboBox1.Text)
If Dir = ComboBox1.Text & "System Volume Information" Then
Else
File.SetAttributes(Dir, IO.FileAttributes.Normal)
End If
Next
Catch
End Try
End Sub
But, you need to check periodically any change in your logical drives added/removed
Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick
If ComboBox1.Items.Item(ComboBox1.Items.Count - 1).ToString <> System.IO.Directory.GetLogicalDrives.Last.ToString Then
ComboBox1.Items.Clear()
Dim dirs() As String = Directory.GetLogicalDrives()
For Me.i = dirs.GetLowerBound(0) To dirs.GetUpperBound(0)
ComboBox1.Items.Add(dirs(i))
Next i
Else
End If
End Sub