Hack Forums
[Shell] [FixTool] Show all hidden folders and files on your USB pendrive by Hackoo - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [Shell] [FixTool] Show all hidden folders and files on your USB pendrive by Hackoo (/showthread.php?tid=5202988)



[FixTool] Show all hidden folders and files on your USB pendrive by Hackoo - Hackoo - Mar 14, 2016

Hi ✌

A batch file to show all hidden files and folders of your USB pendrive.
So ; this batch which automatically detects the letter of your USB stick can also be done automatically as administrator.
It can be used to help people whom are infected by a virus that hides their originals files and folders and transforms them to shortcuts
So we can say it is a fixtool for this problem linked to the consequence of this kind of virus.

👍

Code
@echo off
cls & color 0A & echo.
Mode con cols=75 lines=7
Title Show all hidden folders and files on your USB key by Hackoo 2016
:::::::::::::::::::::::::::::::::::::::::
:: Automatically check & get admin rights
:::::::::::::::::::::::::::::::::::::::::
REM  --> Check for permissions
Reg query "HKU\S-1-5-19\Environment">nul 2>&1
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
Echo.
ECHO                    **************************************
ECHO                     Running Admin shell... Please wait...
ECHO                    **************************************

Goto UACPrompt
) else ( goto gotAdmin )

:UACPrompt
    echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
    set params = %*:"=""
    echo UAC.ShellExecute "cmd.exe", "/c ""%~s0"" %params%", "", "runas", 1 >> "%temp%\getadmin.vbs"

    "%temp%\getadmin.vbs"
    del "%temp%\getadmin.vbs"
    exit /B

:gotAdmin
::::::::::::::::::::::::::::
::START
::::::::::::::::::::::::::::
Set TmpLog=%tmp%\Tmp.txt
Set Log=%tmp%\USBLog.txt
If exist %TmpLog% Del %TmpLog%
for /f "tokens=2" %%i in ('wmic logicaldisk where "drivetype=2" ^|find /i ":"') do (Set MyUSB=%%i)
cls
setlocal ENABLEDELAYEDEXPANSION
set _drive=%MyUSB%
If Exist !_drive! (
cls
echo.
echo           #########################################################
echo                        Your usb key is connected as !_drive!
echo           #########################################################
echo.
pause
Attrib -s -h -r !_drive!\*.* /S /D >> !TmpLog! 2>&1
Cmd /U /C Type !TmpLog! > !Log!
If exist !TmpLog! Del !TmpLog!
Explorer "!_drive!\"
) ELSE (
cls
color 0C
echo.
echo           #########################################################
echo                         Your usb key is not detected
echo           #########################################################
echo.
pause
Exit
)



* - Cynoq - Mar 14, 2016

Great script Hackoo! It's nice to see something hq in this section, keep up the good work!


* - Advertisement - Mar 14, 2016

Ehm, nice script
But would tweaking a little setting not be handier?