A simple batch script to lock and unlock all folders and files in D:\ using the Windows attrib command with basic password protection.
- Lock (hide) all top-level files and folders in
D:\ - Unlock them after entering the correct password
- Skips system-protected folders like
$RECYCLE.BIN - Easy menu-driven interface
+hβ Hides the file/folder+sβ Marks it as a system item (extra hidden)/sβ Applies changes to all subfolders/files/dβ Applies to directories (folders)
-
Download or copy the
DriveLocker.batfile to your system. -
Edit the script in Notepad or any text editor. Find this line:
set password=YourPasswordHere
Replace
YourPasswordHerewith your desired password. -
Double-click
DriveLocker.batto run it. -
Choose an option from the menu:
- 1. Lock all content in D:\ - 2. Unlock content in D:\ - 3. Exit