Introduction: A Batch File That Can Hide/unhide Files/folders

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

Comments

DIY Hacks and How Tos (author)2016-12-18

Clever program. You should think about entering this into the First Time Author's contest.

About This Instructable

135views

6favorites

License:

Bio: started coding 2 years ago
More by C0Ld:A Batch File That Can Hide/unhide Files/folders
Add instructable to: