How to Password Protect a Folder in Windows 10

(Image credit: Tom's Hardware)

Nowadays, all of our information is digital -- from pictures to our banking information and everything in-between. Among these files, we all have sensitive information that, when seen by others, could cause irrevocable harm. Windows 10 doesn’t make it easy to password protect a folder, but we can guide you here on how to protect your most sensitive information.

1. Open the folder you want to protect with a password.

(Image credit: Tom's Hardware)

2. Right-click inside the folder, opening the context menu.

(Image credit: Tom's Hardware)

3. Select New from the context menu.

(Image credit: Tom's Hardware)

4. Click Text Document from the context menu pop-up.

(Image credit: Tom's Hardware)

5. Rename the new text document to “LockedFolder” and press Enter.

(Image credit: Tom's Hardware)

6. Open the “LockedFolder” text document.

(Image credit: Tom's Hardware)

7. Copy the highlighted code below.

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 u 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%==INPUT YOUR PASSWORD HERE 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

8. Paste the code into the “LockedFolder” text document.

(Image credit: Tom's Hardware)

9. In the “LockedFolder” text document, find the phrase “INPUT YOUR PASSWORD HERE”.

(Image credit: Tom's Hardware)

10. Replace “INPUT YOUR PASSWORD HERE” with a password of your choosing. Do not use spaces within your password.

(Image credit: Tom's Hardware)

11. Click File in the header menu of the text document.

(Image credit: Tom's Hardware)

12. Select “Save as” from the drop-down menu.

(Image credit: Tom's Hardware)

13. Change the file name “LockedFolder” to “LockedFolder.bat”.

(Image credit: Tom's Hardware)

14. From the “Save as type” drop-down, select “All Files”.

(Image credit: Tom's Hardware)

15. Click the “Save” button.

(Image credit: Tom's Hardware)

16. Double-click the “LockedFolder.bat” windows batch file.

(Image credit: Tom's Hardware)

17. You will now see a new folder named “Locker”. Select, drag, and drop the files you want locked inside the Locker folder.

(Image credit: Tom's Hardware)

18. Right-click the Windows batch file named “LockedFolder”.

(Image credit: Tom's Hardware)

19. Select “Open” from the context menu.

(Image credit: Tom's Hardware)

20. Type “Y” in the CMD pop-up window and then press Enter on your keyboard. Your locked folder and its contents are now hidden.

(Image credit: Tom's Hardware)

21. To unlock and make the folder visible again, double-click on the “LockedFolder” Windows batch file.

(Image credit: Tom's Hardware)

22. Enter the password you created earlier and press Enter on your keyboard when asked to unlock the folder.

(Image credit: Tom's Hardware)

Repeat these steps again to hide and password protect the folder:

24. Double click the “LockedFolder.bat” Windows batch file.

(Image credit: Tom's Hardware)

25. Type “Y” in the CMD pop-up window and then press Enter on your keyboard.

(Image credit: Tom's Hardware)
  • kerberos_20
    isnt that windows 98 activeX componnent? interresting, but dunno if its really safe if u can get password from that bat file
    Reply
  • archfrog
    Honestly, why not spend that much article space on how to use VeraCrypt instead of how to use a batch file?
    Reply