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. Sure, it's not the cheapest, and it could compress files a little smaller, but it's a great all-rounder. It uses the highest-level encryption key and offers numerous ways to protect your files beyond encryption, including file hiding, file shredding, password help and stealth mode.