Windows batch script to unhide files hidden by virus
Asked Answered
X

4

18

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 -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

@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
Xylia answered 11/11, 2011 at 13:59 Comment(0)
S
28
echo "Enter Drive letter" 
set /p driveletter=

attrib -s -h -a /s /d  %driveletter%:\*.*
Shipboard answered 11/11, 2011 at 14:2 Comment(2)
Strange syntax. Thanks, but didn't work. It show Path on found - C:\users\user\desktop\driveletter:Xylia
Modifying your code it worked like this: @ECHO OFF ECHO "Enter Drive letter" set /p letter= attrib -s -h -a /s /d %letter%:*.*Xylia
O
2

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/

Happy Knowledge Sharing

Omega answered 24/11, 2013 at 6:44 Comment(0)
G
1

this will unhide all files and folders on your computer

attrib -r -s -h /S /D
Guild answered 25/1, 2016 at 20:48 Comment(0)
V
0

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
Vole answered 3/9, 2013 at 2:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.