Created
June 23, 2017 09:34
-
-
Save sohan5005/c5a4756bbbd53291fcd6a18fdcd3977f to your computer and use it in GitHub Desktop.
System hide/unhide a folder or file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF | |
TITLE System Hide/Unhide directory or file | |
GOTO :SET_DIR | |
:SET_DIR | |
SET /P DIRNAME=Enter file/folder name: | |
IF NOT EXIST %CD%\%DIRNAME% GOTO :NOTHING_FOUND | |
:CHOICE | |
CLS | |
ECHO file/folder name : %DIRNAME% | |
SET /P C=Do you want to (H)hide this or (U)unhide this? [H/U] | |
IF /I "%C%" EQU "H" GOTO :HIDE_NOW | |
IF /I "%C%" EQU "U" GOTO :UNHIDE | |
GOTO :CHOICE | |
:HIDE_NOW | |
ATTRIB +S +H "%CD%\%DIRNAME%" | |
ECHO Successfully hidden | |
GOTO :DO_AGAIN | |
:UNHIDE | |
ATTRIB -S -H "%CD%\%DIRNAME%" | |
ECHO Successfully unhidden | |
GOTO :DO_AGAIN | |
:NOTHING_FOUND | |
CLS | |
ECHO Nothing found at "%CD%\%DIRNAME%" | |
GOTO :SET_DIR | |
:DO_AGAIN | |
SET /P C=Do you want to do more? [Y/N] | |
IF /I "%C%" EQU "Y" GOTO :SET_DIR | |
IF /I "%C%" EQU "N" GOTO :EXIT_NOW | |
CLS | |
GOTO :DO_AGAIN | |
:EXIT_NOW | |
CLS | |
ECHO Thank you for using my script! | |
ECHO Follow me on: | |
ECHO Facebook: fb.com/sohan.zaman | |
ECHO Github: github.com/sohan5005 | |
PAUSE | |
EXIT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For Windows O/S only!
.cmd
or.bat
Movies
folder which is located underD:
drive directly, then place this file inD:
drive directly too).Same process applies for hiding/unhiding