Hacks and Tweaks


June 20, 2012

How to lock a folder in Windows without using any software

More articles by »
Written by: arunenigma
Tags: , , , ,


 Follow the steps below:
  • Create a text file and copy the code given below into it.
  • Before copying the code, replace the words password here in Line 14  with password of your choice.
  • Eg: if NOT %pass%== arun1234 goto FAIL attrib -h -s “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}”
  • Note: In example above, I have replaced words password here in original source code with arun1234 (my password)
  • Now save the file (any name you like) with .bat extension meaning the file should end with .bat (Eg. key.bat)
  • When you’ll double-click on the Key.bat file for first time, a folder “Confidential” will be automatically created. You can move all your confidential data in that folder.

Now to lock the folder just double-click on the file “Key”. You will get a confirmation message in Command Prompt. Type “y” to confirm. Now the folder “Confidential” will be locked and hidden.



  • If you want to get access to the contents of the folder then again double-click on the batch file, you have created. Immediately you will be prompted to enter your password. After that you can get access to the folder “Confidential”.


  • By this process you can password protect the folder and no body can get access to the folder without the password. But still there is some risk. If some body is a computer savvy then he can easily retrieve the password from your batch file. He can easily find the password by choosing “Edit” option from the right-click context menu.
  • So, to prevent from that option you can make an executable file of the batch file. The facility of the executable file is that no body can’t see the source code of an exe file. Here I’ve described the process of converting the batch file to executable(.exe) file.
  • At first you need a compiler that compiles the batch file to an executable file.
  • Download Bat to Exe converter
  • Now run the application and put the source path of the batch file, then the target executable file name with location.
  • Click on “Compile” button.




That’s all. Delete the batch file “key.bat”. You can now protect or access the folder by using the exe file (key.exe). Your data is now fully protected.

The above method works in XP, Vista and Windows 7.


Did you enjoy this article? If so, we’d love to hear your thoughts in the comments below. It would be great if you subscribed to our RSS feed or signed up for email updates to get more goodness. There’s lots more where this came from!

About the Author

Computer Science Graduate Student @ Case Western Reserve University, Cleveland, USA



Python Factory Design Patterns using Switch Case

I googled for Factory Method Design Pattern in Python but couldn’t find a good resource. So, I  am sharing an example program to demonstrate this design pattern in Python which I frequently use. The factory method pattern is...
by arunenigma


Conway’s Game of Life Implemetation in Python with cool patterns

he Game of Life (or simply Life) is not a game in the conventional sense. There are no players, and no winning or losing. Once the “pieces” are placed in the starting position, the rules determine everything that ha...
by arunenigma


Python AVL Tree Implementation with ASCII visualization

n computer science, an AVL tree is a self-balancing binary search tree. It was the first such data structure to be invented. In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at any tim...
by arunenigma



Binary Search Tree in Python with ASCII art visualization

Binary search tree implementation in Python with: in, post and pre-order traversals. Also includes methods for insertion, deletion and search of nodes. Deletion is fairly complex and is made possible by keeping track of parents...
by arunenigma


Python, Memoization, Dynamic Programming, Fibonacci Series and some Fun!

ython can implement the recursive formulation directly, caching return values. Memoization is a method where if a call is made more than once with the same arguments, and the result is returned directly from the cache. For exam...
by arunenigma



Be the first to comment!

You must be logged in to post a comment.