It’s important to note that this will not actually conceal your data from somebody who knows what they are doing.
Note: if you are a beginner you should not do this. We get emails once a week from people that don’t know what they are doing and complain they can’t find their files anymore. We also have instructions at the bottom for how to see the files again should you forget how to see them.
Create Your Password Protected FolderBefore you get started you need to create a folder that will house your password protected folder, this is just an ordinary folder and can be located anywhere and named anything.
title Folder Private
if EXIST "HTG Locker" goto UNLOCK
if NOT EXIST Private goto MDLOCKER
echo Are you sure you want to lock the folder(Y/N)
if %cho%==Y goto LOCK
if %cho%==y goto LOCK
if %cho%==n goto END
if %cho%==N goto END
echo Invalid choice.
ren Private "HTG Locker"
attrib +h +s "HTG Locker"
echo Folder locked
echo Enter password to unlock folder
if NOT %pass%== PASSWORD_GOES_HERE goto FAIL
attrib -h -s "HTG Locker"
ren "HTG Locker" Private
echo Folder Unlocked successfully
echo Invalid password
echo Private created successfully
Change the PASSWORD_GOES_HERE text to the password you want to set.
Now go ahead and save the file as locker.bat.
You will see that your Private folder quickly disappears.
If you enter the same password as you set in the script the Private folder will reappear if you enter the incorrect password the script will just Terminate.
How to See the Files AgainMost people don’t know how to show system files, but anybody who has some experience will probably be able to quickly figure it out in the Folder Options. To see the files again, all you have to do is uncheck the boxes for “Show hidden files, folders, and drives” and uncheck the box for “Hide protected operating system files”.
The second way someone could comprise the folder is to open the batch file and read your password. It’s definitely not a really secure way to hide your files, but it is fun.
Attribution note: We found this script on dozens of different web sites going back many years. We have no idea who first created the script, so we’ve omitted any sort of attribution link. If you do have proof that you first created the script, contact us and we’ll adjust the article accordingly.