How to Lock a Folder in Windows 7 or Above?
Microsoft keeps on upgrading its Windows Operating System consistently to improve User experience and Security.
These new upgrades also keep the associated software industry busy in making changes to their old softwares compatible with new OS upgrades.
The technique in this article uses the old Windows programming concepts of creating a file handler and keeping it open with exclusive access. As long as this handler is open, others cannot use this folder, providing a Lock on folder.
Yes. It is true that you can develop your own lock a folder application in just 2 minutes.
Create a New Excel File, save it with xlsm format and follow the steps explained below to lock a Folder.
Type the Folder name with full path in Sheet1 Cell A1.
Now, press Alt + F11 to view VB editor.
Copy this code and Paste it in VB Editor.
How to Lock a Folder in Windows 7?
MsgBox "Folder Locked - Subscribe Email to Get New Code Updates"
All you need to have is Microsoft Excel with Macro Enabled and little knowledge in Excel. That’s it. You have created a Folder Lock Software on your own.
Now, minimize Excel and try to open the Folder “D:\Folder_Lock_Testing”. You will get a error message and Windows will not allow you to open the Folder.
There is a limitation to this method. The Folder will be locked only as long as the Excel is executing. Once you close the Excel, the Locked folder will be accessible again or use the below code to unlock by yourself.
This is just a beginner level tutorial that explains one of the plenty of methods available to lock a Windows Folder.
The code here makes use of Windows API function to create a File handle. The same module can be used in a VB application as well.
If you are familiar with VB applications, then you can develop your own Windows Desktop application that can Lock a Folder in Windows System. Since Locking a Folder corresponds to security, this area needs upgrades with every new Windows release.