This method is not a secure way to protect your files and folders. Follow the below steps, and you should have a working batch script to lock a folder in Windows.
This method is perfect for hiding and protecting not-so-important files that you don’t want others to see. When needed, you have to enter the password in the batch file to reveal the folder.
All you have to do is add all the contents you want to lock away in the folder created by the batch file, lock the folder, and the batch file will completely hide it from plain sight. The simplest way to lock a folder in Windows is to use a batch file. Use Batch File to Password Protect and Lock Folder in Windows 10 & 11