1

My Windows 7 was recently infected by the system-fix.com virus and it hid all my files and directories. I believe I've removed the virus but I still can't find many files and programs.

Is there a single command-line tool in Windows that can recursively turn off the hidden attribute for an entire drive?

2

4 Answers 4

1

Unhide is designed specifically to address this symptom.

When run, it will unhide (-H) all +H files on the fixed disks of your computer. It will not, though, unhide any files that also have the +S attribute.

Refer to the Removal Guide for System Fix for further information.

4

I think attrib -H /S /D should do the trick.

1

You may also try this simple windows script for unhiding files and directories. It only prompts the user to input the drive letter then executes the vbscript.

Run your notepad, copy the code below, then save it as unhide.vbs

pc_drive = InputBox("Input drive letter" & vbnewline & "example: E:\", "Drive","E:\")
ryt = Right(pc_drive,2)
   If Len(pc_drive) <> 3 or ryt <> ":\" Then
   Call MsgBox("Either your input was invalid or the drive you specified doesn'texist",vbokonly,"Error")
End If

Set FSO = CreateObject("Scripting.FileSystemObject")
ShowSubfolders FSO.GetFolder(pc_drive)

Sub ShowSubFolders(Folder)
   str =""
   For Each Subfolder in Folder.SubFolders
      str =str & " " & Subfolder.Path
      subFolder.Attributes = 0
      ShowSubFolders Subfolder
   Next
End Sub

You could save it in your USB drive for more accessibility. Instruction how to use it can be found in the link below.

Windows Script For Unhiding Folders Hidden By Worm Virus

EDIT: provided the vbscript code.

3
  • 1
    Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.
    – Sathyajith Bhat
    Jul 23, 2012 at 7:28
  • I just edited my answer. I appreciate your suggestion.
    – Mr. Xymon
    Jul 24, 2012 at 8:16
  • Thanks for taking the time and adding the content. The reason we ask to do this is to prevent content loss due to link rot. Cheers.
    – Sathyajith Bhat
    Jul 24, 2012 at 8:23
0

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!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.