Best of all, you can add the password you choose to a folder without downloading additional programs . Below these lines we tell you how to do it.
The method that we are going to explain to you below works for practically all versions of Windows . In our case, we have tested it with Windows 10 and 11, since they are the most used Microsoft operating systems.
A script that makes our folder disappear and adds a password
The idea is that you can copy and paste the code that we are going to leave you below , so that you can create a BAT file from Windows Notepad and save it on your system. This file will be the gateway to your folder, having to enter the password to see it. Under these lines we indicate all the steps.
- Copy the following code into Notepad or any other similar text editor.
cls
ECHO OFF
title Folder CarpetaProtegida
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
if NOT EXIST CarpetaProtegida goto MDLOCKER
:CONFIRM
echo Quiere ocultar la CarpetaProtegida? (S/N)
set/p "cho="
if %cho%==S goto LOCK
if %cho%==s goto LOCK
if %cho%==n goto END
if %cho%==N goto END
echo Invalid choice.
goto CONFIRM
:LOCK
ren CarpetaProtegida "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
echo Folder locked
goto End
:UNLOCK
echo Introduzca la contrasena para mostrar la CarpetaProtegida
set/p "pass="
if NOT %pass%== ELIGE-CONTRASEÑA goto FAIL
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" CarpetaProtegida
echo Folder Unlocked successfully
goto End
AIL
echo Invalid password
goto end
:MDLOCKER
md CarpetaProtegida
echo CarpetaProtegida created successfully
goto End
:End
- Where does it say?ProtectedFolder? you can replace it with any other name you want to give the folder.
- In ?CHOOSE-PASSWORD? you must enter the password with which you want to protect your folder.
- Once you have the script ready, save it as a BAT file , giving the file whatever name you want and adding the .bat extension to the end. If you’re in Notepad, don’t forget to select the ?All files? option.
When you double click on the file, a folder will be automatically created in the path where you saved it . If you double click on the BAT file again you will be able to hide the folder, and if you want it to be shown again, you will have to enter the password.
The method is very useful if you want to save files in a protected folder. However, it has a major problem. And it is that anyone can edit the script of the file and enter a different password, so if you want to keep your folder safe, you better hide the executable file well.
In case you want to protect your folders more securely, you can also use third-party applications like VeraCrypt , or even compress the folder with WinRAR or 7zip with a password.