Hello, I'm Quinn and here to help!
To do it, open Notepad and Paste this:
@echo off
title Folder Locker
if EXIST "LockedFolder" goto UNLOCK
if NOT EXIST "CHANGETHISFOLDERNAME" goto MDLOCKER
:CONFIRM
echo Are you sure you want to lock this folder? (Y/N)
set /p "cho=>"
if /I "%cho%"=="Y" goto LOCK
if /I "%cho%"=="N" exit
goto CONFIRM
:LOCK
ren CHANGETHISFOLDERNAME "LockedFolder"
attrib +h +s "LockedFolder"
echo Folder locked
goto End
:UNLOCK
echo Enter password to unlock folder
set /p "pass=>"
if NOT "%pass%"=="YOUR_PASSWORD" goto FAIL
attrib -h -s "LockedFolder"
ren "LockedFolder" CHANGETHISFOLDERNAME
echo Folder unlocked
goto End
:FAIL
echo Invalid password
goto End
:MDLOCKER
md CHANGETHISFOLDERNAME
echo Folder 'CHANGETHISFOLDERNAME' created. Put your files inside it.
goto End
:End
- Replace
YOUR_PASSWORD with your any password you like.
-
CHANGETHISFOLDERNAME is the name of the folder you’ll put files in. To change it, replace it with your preferred folder name.
- Once you’re ready with the password and folder name, in Notepad, go to File > Save As
- For the file name, enter anything you want as long as it ends with
.bat (e.g., sample.bat)
- For Save as type, select All Files, then click Save
- Double-click the
.bat file you created to run it.
- Enter your password to access the folder.
- To lock the folder again, open the
.bat file and type Y when prompted.
This method is preferable for everyday use but lacks security, as the file can be edited and viewed in Notepad. You can also download and use WinRAR for a more secure approach by locking your files with a password. It can be used for free.
Feel free to let me know if you need further assistance, I'd be glad to help you further.