In versions prior to Windows 8, this was not possible and people had to use 3rd party tools to achieve this. Lucky we are, to be alive in the reign of Windows 8/8.1 and 10 – where this is super easy.
Locking a Folder in Windows 8/8.1/10:
No third party software are needed to achieve this. Follow these simple steps. Navigate to the folder where the files you want to protect are present. Open the folder and right click inside the empty space to create a new text document. For this purpose, navigate to New > Text Document inside the contextual menu. A new text file will be created as a result. You don’t need to name this file for now.
Double click the text file to open it in notepad and Paste the following code mentioned. After pasting the code inside the text file, search for “Write-Password-Here” To save your time, you can press CTRL + F shortcut key combination on the keyboard and type “Write-Password-Here” inside the search field. Click on Find Next button to let it search for you. It would highlight the text you searched for. Replace the “Write Password-Here” text to any password you want to use to access the folder. @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
After typing your relevant password, click on File at the top left of the notepad application and select Save As. On the Save As window appearing after, move to the Save As type section and select the All Files from the list. Change the name of the file by navigation to File name section and type “Folder Locker.bat” (without quotes). Then click Save. Double click the bat file and it would run the script to generate a new folder called Locker inside the same folder. Now, you can move the files you want to lock into this Locker folder. Now, you need to open the bat file again. A command prompt will be launched as a result. Type Y inside the command prompt and hit Enter key. It would lock the folder as well as diminish the locked folder from the screen.
To unlock the folder, double click on the bat file again and type the password you entered before. In my case, I will type appuals and hit Enter key to get my locked folder back. To lock the folder again, you need to repeat the steps from saving the Folder Locker.bat.
Fix: Could not open lock file /var/lib/dpkg/lockHow to Restore Folder Lock 7.x PasswordHow to Select and Specify a Static Lock Screen and Logon Image in Windows 10?How to Prevent Users from Changing Lock Screen and Logon Image in Windows 10?