Locking Folders in Windows 10

 
  1. Copy the code below into a text file.
  2. Change ‘your_password’ on line 23 to a password of your choice.
  3. File > Save As.
  4. Save the file as lock.bat and change the encoding to ANSI.
  5. Run the batch file, a folder called Locker should be created.
  6. Put what you want in the ‘Locker’ folder
  7. Run the lock batch file and confirm that you want to lock the folder by typing Y and pressing enter.
  8. The ‘Locker’ folder will then disappear.
  9. To show it again, run the lock file and enter your password, follwed by enter.
  10. The folder will then re-appear.
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%==your_password 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