How to Lock a Folder in Windows 8/8.1 and 10

Originally published at: How to Lock a Folder in Windows 8/8.1 and 10

Privacy is a serious concern for some and computer’s are part of life for everyone. Many users have asked about how to protect/lock their data inside a folder the easy way so only they can access it. Some users cannot restrict their use of PCs to their family members and friends, or work colleagues and…

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%==Write-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

(I made some changes, try this instead of the one mentioned in the article)

It lets me open the folder fine and when typing “Y” in the thing it flashes under it “goto was unexpected at this time”. Also My thing still says Folder Locker.bat

please upload the lock file to www.wikisend.com and send me the link to check.

I tried doing this, but I can still open the folder without any problems. I am on Windows 10. When I enter Y or my password into the .bat file, something flashes under my command for a split second, i think it says something along the lines of “goto was unexpected at this time”. Any help?

I tested this on Windows 10 and it did work.

Hi I used this Locker Batch File but unfortunately, after 1 day it will expire. I will not be able to lock the folder again using the batch file. It will do nothing. how can i permanently use this batch file. By the way I am using WINDOWS 10