I had the same problem and I found a solution on Stackoverflow (you can take a look at https://stackoverflow.com/questions/8095002/windows-batch-script-to-unhide-files-hidden-by-virus ).
This code will make visible only the directories.
So, create a BAT file ( open the Notepad, copy + paste the below code and rename the file to fix.bat) which will contains:
echo "Enter Drive letter"
set /p driveletter=
attrib -s -h -a /s /d %driveletter%:\*.*
Also, I modified a bit the code provided by Mr. Xymon to avoid make Recycled Bin visible and to avoid Windows Permission Error.
Here is the code:
' Skip some folders to avoid Windows Error Message
If (CurrentFolder.Name <> "RECYCLER") and (CurrentFolder.Name <> "System Volume Information") and (CurrentFolder.Name <> "$RECYCLER.BIN") and (CurrentFolder.Name <> "Config.Msi") Then
For Each Subfolder in CurrentFolder.Subfolders
If (Subfolder.Name <> "RECYCLER") and (Subfolder.Name <> "System Volume Information") and (Subfolder.Name <> "$RECYCLER.BIN") and (Subfolder.Name <> "Config.Msi") Then
Subfolder.Attributes = Subfolder.Attributes AND 0
' Main program
pc_drive = InputBox("Input drive letter." & vbnewline & vbnewline & "Example: G:\", "Drive","G:\")
ryt = Right(pc_drive,2)
If Len(pc_drive) = 3 or ryt = ":\" Then
Set FSO = CreateObject("Scripting.FileSystemObject")
' Check if the path exists or if the drive is ready
If FSO.FolderExists(pc_drive) Then
Call MsgBox("Our script will start after you click OK. Please wait the Finish Message!!!",vbokonly,"Starting...")
' TO DO: Add a progress bar here
Call MsgBox("Either your input was invalid or the drive you specified doesn't exist.",vbokonly,"Error")