windows - unhide usb files batch commands -
i on windows 8.1. usb hidden file/folders. unhide them use attrib command . want run commands inserting usb. pl help.
echo off echo please have patience!!! wait or minimise window!!! rem c:\script\unhide.bat @echo off /f "usebackq tokens=1,2,3,4 " %%i in (`wmic logicaldisk caption^,description^,drivetype 2^>nul`) ( if %%l equ 2 ( echo %%i usb drive. ) ) pause here got drive letter h. unable use drive letter , use following commands in usb. how can run below commands in usb. mean change drive, run attrib command in usb, delete unwanted files usb , see usb's contents.
cd\ attrib -s -h -r /s /d del *.lnk del thumbs.db del desktop.ini del autorun.inf echo folders has been recovered!!! check folders , files dir pause exit
@echo off setlocal enableextensions echo please have patience!!! wait or minimise window!!! rem c:\script\unhide.bat /f "skip=1 tokens=1-3" %%i in (' wmic logicaldisk "drivetype=2" caption^,drivetype^,systemname ') ( if "%%j"=="2" ( echo "%%i" usb drive ^(drivetype=%%j^). pushd "%%i\" setlocal enabledelayedexpansion echo current folder !cd! endlocal echo attrib -h -s -t /s /d /l >nul 2>&1 echo del *.lnk 2>nul echo del thumbs.db 2>nul echo del desktop.ini 2>nul echo del autorun.inf 2>nul echo folders has been recovered!!! check folders , files dir pause popd ) ) endlocal goto :eof note:
wmiccommand changed follows:whereclause;descriptionomitted property vary in word number , therefore breaks tokenization;- always non-empty property
systemnameappended pass on ending carriage return in line returned:wmicbehaviour = each output line ends0x0d0d0a(<cr><cr><lf>) instead of common0x0d0a(<cr><lf>). (general) approach see dave benham'swmic,for /f: fix trailing<cr>problem;
for /floop adapted according alteredwmiccommand (andskip=1);- operational
attrib -h -s -t /s /d /lmerelyechoed debugging purposes; removeechono sooner debugged (the samedelcommands); - used
pushd-popdpair:pushdchanges current directory/folder , stores previous folder/path usepopdcommand; - folder
system volume informationshould keep attributessystem&hiddenif present.
Comments
Post a Comment