Lock folders without software in Windows

Third-party software is available if you wish to secure any files in your computer (by adding locks and password protection) and render these private. There are also some methods wherein additional software is unnecessary, locking certain files may be achieved by executing a few, relatively simple tweaks.

Here are a couple of ways to lock folders by coding, without resorting to any software:

Method 1

Open your computer’s Notepad program.

Copy the following code to a new Notepad document. Save the document under the file name [locker. bat].

title Folder Locker
if EXIST “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}” goto UNLOCK
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.
ren Locker “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}”
attrib +h +s “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}”
echo Folder locked
goto End
echo Enter password to Unlock folder
set/p “pass=>”
if NOT %pass%==[enter 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

*Note that the folder will be in the same path as that of the ‘.bat’, or batch file.

Remember to enter your chosen password in the appropriate location within the code. After creating the ‘locker’ folder, click on [locker.bat]. This will prompt you to press the ‘Y’ key on your keyboard, and then confirm with the Return or ‘Enter’ key. The ‘locker’ folder will become invisible.

Retrieve the folder by clicking on [locker.bat]. Again, press ‘Y’ and the ‘Enter’ key. Enter your password to obtain access to the folder.

Method 2

Select the folder you wish to lock. Assume that ‘folder’ is the private folder you want to secure, and its location is drive E:\.

Create 2 ‘.bat’ files in the same drive. Make a new text file in that location. Access that text file via Notepad. Enter the following code:
[ren folder folder.{21EC2020-3AEA-1069-A2DD-08002B30309D}] Save this as ‘lock.bat’

Open one more text file and enter this code: [ren folder.{21EC2020-3AEA-1069-A2DD-08002B30309D} folder] Save this one as ‘unlock.bat’.

You currently have 2 batch files under the names ‘lock’ and ‘unlock’. Double-click [lock.bat]. The folder icon will turn into that of the Control Panel, and the contents are inaccessible for viewing.

Simply double-click the [unlock.bat] file to revert to the original folder.

How outdated are your PC drivers?
Old drivers harm system performance and make your PC vulnerable to errors and crashes.

Posted in Data Storage

(comments are closed).