用于取消隐藏被病毒隐藏的文件的 Windows 批处理脚本

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8095002/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 08:55:25  来源:igfitidea点击:

Windows batch script to unhide files hidden by virus

windowsbatch-filehidden

提问by msmafra

Since I'm seing many people having their files hidden by flash drive viruses, I'm giving them a Windows command line using attrib(or using Linux) to solve the problem when the infected files are removed and the their files are still "missing". The command removing file and folders properties system, hidden and arquive (not really needed):

由于我看到很多人的文件被闪存驱动器病毒隐藏,我给他们一个使用attrib(或使用 Linux)的 Windows 命令行来解决当受感染的文件被删除并且他们的文件仍然“丢失”时的问题”。删除文件和文件夹属性系统、隐藏和 arquive 的命令(不是真的需要):

attrib -s -h -a /s /d <drive letter>:\*.*

Does anyone know a how to make a script to prompt the user for the drive letter or folder? I've already seen some software that does something like this but I think this would be better.

有谁知道如何制作一个脚本来提示用户输入驱动器号或文件夹?我已经看到一些软件可以做这样的事情,但我认为这会更好。

thx!

谢谢!

[Solved] Solved using Cheeso's code as base

[已解决] 以 Cheeso 的代码为基础解决

@ECHO OFF
ECHO "Enter Drive letter"
set /p letter=

attrib -s -h -a /s /d %letter%:*.*

[Improved a bit]

[稍有改善]

@ECHO OFF
ECHO Type the drive letter. ONLY the letter.
ECHO ALL FILES ARE GOING TO BE MODIFIED!!!
set /p letter=

ECHO %letter%: selected
taskkill /im explorer.exe /f
ECHO.
ECHO "Modifying files..."
ECHO.

attrib -s -h -a /s /d %letter%:\*.*

ECHO "Process completed."

start explorer %letter%:
taskkill /im cmd.exe /f

回答by Cheeso

echo "Enter Drive letter" 
set /p driveletter=

attrib -s -h -a /s /d  %driveletter%:\*.*

回答by Vimal Ghorecha

Try this.

尝试这个。

Does not require any options to change.

不需要更改任何选项。

Does not require any command line activity.

不需要任何命令行活动。

Just run software and you will done the job.

只需运行软件,您就可以完成工作。

www.vhghorecha.in/unhide-all-files-folders-virus/

www.vhghorecha.in/unhide-all-files-folders-virus/

Happy Knowledge Sharing

快乐知识分享

回答by zask

this will unhide all files and folders on your computer

这将取消隐藏您计算机上的所有文件和文件夹

attrib -r -s -h /S /D

回答by user2741529

Try this one. Hope this is working fine.. :)

试试这个。希望这一切正常.. :)

@ECHO off

cls

ECHO.

set drvltr=

set /p drvltr=Enter Drive letter: 

attrib -s -h -a /s /d  %drvltr%:\*.*

ECHO Unhide Completed

pause