A Batch File That Can Hide/unhide Files/folders
by C0Ld in Circuits > Computers
3293 Views, 8 Favorites, 0 Comments
A Batch File That Can Hide/unhide Files/folders
@echo off
:start
color 1f
title Choice
set "cols=35"
set "lines=4"
mode con: cols=%cols% lines=%lines%
cls
echo 1. Hide Files/Folders...
echo 2. Unhide Files/Folders...
choice /N /C:12
If Errorlevel 2 Goto unhide
If Errorlevel 1 Goto hide goto start
:hide
color 1f
title Hide
set "cols=50"
set "lines=50"
mode con: cols=%cols% lines=%lines%
cls
echo Current directory (not hidden files):
echo __________________________________________________
dir /B %CD%
echo.
echo.
echo.
echo.
echo __________________________________________________
echo Type the folder/file that you want to hide: set /p input= :
set "cols=35"
set "lines=4"
mode con: cols=%cols% lines=%lines%
cls
attrib +s +h %CD%\"%input%" >nul && echo Successfully hidden [%input%]
ping localhost -n 4 >nul
exit
:unhide
color 1f
title Unhide
set "cols=50"
set "lines=50"
mode con: cols=%cols% lines=%lines%
cls
echo Current directory (hidden files):
echo __________________________________________________
dir /A:H /B %CD%
echo.
echo.
echo.
echo.
echo __________________________________________________
echo Type the folder/file that you want to unhide: set /p input= :
set "cols=35"
set "lines=4"
mode con: cols=%cols% lines=%lines%
cls
attrib -s -h %CD%\"%input%" >nul && echo Successfully unhidden [%input%]
ping localhost -n 4 >nul
exit