Whether you’re trying to protect sensitive files or just want to keep your stuff private, locking a folder in Windows 10 is a handy skill. You can do this with built-in tools or third-party software, but today we’ll show you an easy way to do it using only what’s already on your computer. By the end of this guide, you’ll know how to lock a folder so only you can access it.
How to Lock a Folder on Windows 10
In this section, we’ll walk you through the steps to lock a folder on Windows 10. By following these steps, you’ll create a password-protected folder using a simple batch script.
Step 1: Create a New Folder
First, create a new folder where you’ll keep the files you want to lock.
To do this, right-click on your Desktop, select “New,” and then click “Folder.” Name this folder something you’ll remember.
Step 2: Open Notepad
Open Notepad by searching for it in the Start menu or pressing Win + R, typing notepad, and hitting Enter.
Notepad is a simple text editor that will let you write the script needed to lock your folder.
Step 3: Copy and Paste the Script
Copy the below script and paste it into Notepad:
cls
@ECHO OFF
title Folder Locker
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
if NOT EXIST Locker goto MDLOCKER
:CONFIRM
echo Are you sure you want to lock the folder? (Y/N)
set/p "cho=>"
if %cho%==Y goto LOCK
if %cho%==y goto LOCK
if %cho%==N goto END
if %cho%==n goto END
echo Invalid choice.
goto CONFIRM
:LOCK
ren Locker "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
echo Folder locked
goto End
:UNLOCK
echo Enter password to unlock folder
set/p "pass=>"
if NOT %pass%== YourPasswordHere goto FAIL
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" Locker
echo Folder Unlocked successfully
goto End
:FAIL
echo Invalid password
goto end
:MDLOCKER
md Locker
echo Locker created successfully
goto End
:End
Replace “YourPasswordHere” with the password you want to use.
Step 4: Save the File as a Batch File
Save the file as “locker.bat” by selecting “File” > “Save As,” and then type “locker.bat” in the “File name” field. Choose “All Files” as the “Save as type” option.
Make sure you save it inside the folder you created in Step 1.
Step 5: Run the Batch File
Double-click on “locker.bat” to create a folder named “Locker.” Move all the files you want to lock into the “Locker” folder.
Once your files are in the “Locker” folder, double-click “locker.bat” again and follow the prompts to lock the folder.
Step 6: Verify Folder is Locked
Check that the “Locker” folder is hidden and inaccessible by trying to open it. You’ll need to run “locker.bat” and enter your password to access it again.
Once you’ve verified it’s locked, you’re good to go.
After you’ve completed the action of locking your folder, you’ll notice that the “Locker” folder disappears. To access your files again, double-click “locker.bat,” enter your password, and the folder will reappear.
Tips for How to Lock a Folder on Windows 10
- Backup Your Password: Always write down your password somewhere safe so you don’t forget it.
- Use Strong Passwords: The stronger the password, the safer your folder will be.
- Test the Script: Before moving sensitive files, test the script with non-essential files to ensure it works properly.
- Keep the Batch File Safe: Don’t rename or move the batch file, as it’s essential for accessing your locked folder.
- Update Regularly: Review and update your security settings periodically to ensure they meet your needs.
Frequently Asked Questions
Can I lock more than one folder using this method?
Yes, you can create multiple “locker.bat” files for different folders.
What if I forget my password?
Unfortunately, you’ll have to remember your password to unlock the folder. There’s no recovery method for this script.
Is this method safe?
While effective, it’s not foolproof against advanced hacking. For higher security, consider third-party software.
Can I use special characters in my password?
Yes, special characters can make your password stronger.
Do I need to run the batch file every time?
Yes, you’ll need to run the batch file and enter your password to unlock the folder each time you want access.
Summary
- Create a new folder.
- Open Notepad.
- Copy and paste the script.
- Save the file as “locker.bat.”
- Run the batch file.
- Verify the folder is locked.
Conclusion
Locking a folder on Windows 10 isn’t rocket science. By following these simple steps, you can make sure your private files stay private. Remember, while this method is straightforward and effective, it’s always good to keep a backup of important files elsewhere just in case. If you’re dealing with particularly sensitive information, you might want to explore additional security measures or third-party software. This method is a great starting point, though, and perfect for everyday use. So go ahead, give it a try and keep those nosy parkers out of your business!
Matthew Burleigh has been writing tech tutorials since 2008. His writing has appeared on dozens of different websites and been read over 50 million times.
After receiving his Bachelor’s and Master’s degrees in Computer Science he spent several years working in IT management for small businesses. However, he now works full time writing content online and creating websites.
His main writing topics include iPhones, Microsoft Office, Google Apps, Android, and Photoshop, but he has also written about many other tech topics as well.