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:
Sub ShowSubFolders(CurrentFolder)
' 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
End If
ShowSubFolders(Subfolder)
Next
End If
End Sub
' 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
ShowSubfolders(FSO.GetFolder(pc_drive))
Call MsgBox("Done!",vbokonly,"Finished")
Else
Call MsgBox("Either your input was invalid or the drive you specified doesn't exist.",vbokonly,"Error")
End If
End If
Cheers!
2If your computer has had a virus, the only truly safe thing to do is back up your files and apps and re-install your operating system from fresh media. – Joel Coehoorn – 2011-12-10T03:52:43.810
1
SuperUser already has "Computer is infected by a virus or a malware, what do I do now?", note.
– JdeBP – 2011-12-10T12:28:17.333