How To Lock Folder With Password Without Software

There is much software that will provide you this feature but there is a problem with that. if by any means that software is un-installed you might lose your personal data because of the login credentials will be deleted. In this tutorial, you will learn to create your own method to lock a folder with password protection.

How To Lock a Folder With Password 

Step1

Create a Folder name ‘PRIVATE’ inside of the folder you want to save your content.

Step2

Now open ‘NotePad or any other ‘Editor de texto’. Remember to create that notepad file outside that folder.

Step3

Copy the below code and paste it in that Note Pad file by typing your password in “CHANGE_YOUR_PASSWORD”.

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 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%==mypassword 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
 
Here mypassword is the password for that folder; replace it with your password (without the space).

Step4

Now save this file as “LOCKER.BAT”.

Step5

Once you did that delete your Notepad file because there will be a BAT file to use.

Step6

Now run that LOCKER.BAT file and you will see a CMD window. In there Press ‘Y’ to lock the folder. Every-time when you need to see your private data you have to run that file and enter the password to access your private data.

Conclusión 

You can easily lock a folder in a few clicks. Complete folder protection without any software. Let us know if you faced any issues during folder locking. You can easily save your personal documents and files inside that folder and lock them.

// Constants for DOM elements const dropdownTriggers = document.querySelectorAll('.dz-menu-item.dropdown'); const dropdownContent = document.querySelector('.dz-dropdown-content'); const dropdownPanels = document.querySelectorAll('.dz-dropdown-panel'); const header = document.querySelector('.dz-header-wrap');// State to track the currently open menu item element let activeDropdownElement = null; let closeTimer = null; // Timer for delayed closing// Function to close all dropdowns function closeAllDropdowns() { if (closeTimer) { clearTimeout(closeTimer); closeTimer = null; } // Only proceed if the elements exist if (dropdownContent) { dropdownContent.classList.remove('open'); } dropdownPanels.forEach(panel => panel.classList.remove('active')); dropdownTriggers.forEach(item => item.classList.remove('active')); activeDropdownElement = null; }// Function to open a specific dropdown function openDropdown(item, targetPanel) { if (closeTimer) { clearTimeout(closeTimer); closeTimer = null; } // 1. Close all others closeAllDropdowns(); // 2. Open the new one item.classList.add('active'); targetPanel.classList.add('active'); if (dropdownContent) { dropdownContent.classList.add('open'); } activeDropdownElement = item; }// Event listener for each dropdown menu item dropdownTriggers.forEach(item => { item.addEventListener('click', function(e) { e.preventDefault(); const panelName = this.getAttribute('data-panel'); const targetPanel = document.querySelector(`.${panelName}`); if (!targetPanel) return;const isCurrentlyActive = this === activeDropdownElement;if (isCurrentlyActive) { // If the same dropdown is clicked, close it immediately. closeAllDropdowns(); } else { // Open the new dropdown openDropdown(this, targetPanel); } }); });/* --- MOUSE EVENTS FOR STABILITY FIX --- */ if (header) { // 1. When the mouse leaves the entire header area (menu + dropdown bar), start a timer to close it. header.addEventListener('mouseleave', () => { // Only initiate close if a dropdown is currently active if (activeDropdownElement) { // Set a delay (e.g., 300ms) to allow the user to move the mouse slightly closeTimer = setTimeout(closeAllDropdowns, 300); } });// 2. If the mouse re-enters the header area before the timer fires, cancel the close. header.addEventListener('mouseenter', () => { if (closeTimer) { clearTimeout(closeTimer); closeTimer = null; } }); }// 3. Close when clicking anywhere outside the header (as a fallback) document.addEventListener('click', (e) => { // Check if header exists and if the click is outside the header AND a dropdown is open if (header && !header.contains(e.target) && activeDropdownElement) { closeAllDropdowns(); } });// Initial setup: ensure all are closed on load document.addEventListener('DOMContentLoaded', closeAllDropdowns); window.addEventListener('load', closeAllDropdowns);
Ir arriba