我的 Windows 7 最近感染了 system-fix.com 病毒,它隐藏了我的所有文件和目录。我相信我已经删除了病毒,但我仍然找不到许多文件和程序。
Windows 中是否有一个命令行工具可以递归关闭整个驱动器的隐藏属性?
答案1
答案2
我认为attrib -H /S /D
应该可以奏效。
答案3
您也可以尝试这个简单的 Windows 脚本来取消隐藏文件和目录。它只提示用户输入驱动器号,然后执行 vbscript。
运行记事本,复制以下代码,然后将其保存为取消隐藏.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
您可以将其保存在 USB 驱动器中,以便更方便地访问。如何使用它的说明可以在以下链接中找到。
编辑:提供了 vbscript 代码。
答案4
我遇到了同样的问题,我在 Stackoverflow 上找到了解决方案(你可以看看https://stackoverflow.com/questions/8095002/windows-batch-script-to-unhide-files-hidden-by-virus)。
此代码将仅使目录可见。
因此,创建一个 BAT 文件(打开记事本,复制 + 粘贴以下代码并将文件重命名为修复程序) 包含以下内容:
echo "Enter Drive letter"
set /p driveletter=
attrib -s -h -a /s /d %driveletter%:\*.*
另外,我修改了 Xymon 先生提供的代码以避免 make回收站可见并避免 Windows 权限错误。
以下是代码:
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
干杯!