ACL-based file and folder locking utility for Windows
A professional CLI/TUI tool for locking and unlocking files and folders on Windows using NTFS ACL permissions. Perfect for developers, security researchers, and power users who need quick, permission-based access control.
π Lock/Unlock Files & Folders - Use Windows ACL permissions to deny/grant access
πΎ Automatic Backups - Original permissions saved before locking
π¨ Dual Interface - Both CLI (scriptable) and TUI (interactive) modes
π Status Checking - View lock status and backup information
β‘ Fast & Lightweight - Pure PowerShell, no external dependencies
π‘οΈ Safe by Design - Administrators always retain recovery access
π Audit Logging - Track all operations with timestamps and notes
- β Protects against normal user access
- β Prevents accidental file access/modification
- β Suitable for quick permission-based locking
- β Does NOT provide encryption
- β Administrators can always unlock
- β Not suitable for protecting against privileged users
- Windows 10/11 or Windows Server 2016+
- PowerShell 7.0 or later
- NTFS file system
- Administrator privileges (for lock/unlock operations)
Run as Administrator:
iwr https://raw.githubusercontent.com/mini-page/acllock/main/install.ps1 | iex- Download or clone this repository
- Run as Administrator:
cd path\to\acllock
.\install.ps1This will:
- Copy files to
C:\Program Files\acllock - Add acllock to system PATH
- Make
acllockcommand available globally
# Lock a file
acllock lock "C:\SecretFiles\document.txt"
# Lock a folder with a note
acllock lock "C:\Projects\Confidential" -Note "Project freeze"
# Unlock a file
acllock unlock "C:\SecretFiles\document.txt"
# Check lock status
acllock status "C:\SecretFiles"
# Dry run (preview changes)
acllock lock "C:\Test" -DryRun
# Force operation (skip confirmations)
acllock unlock "C:\Test" -Force
# JSON output (for scripting)
acllock status "C:\Test" -Json
# Backup ACL before manual changes
acllock backup "C:\Important"
# Restore ACL from backup
acllock restore "C:\Important"acllock tuiNavigate using the menu:
- Lock/unlock files and folders
- Check status
- Create/restore backups
- View help and emergency recovery info
- Backup - Original ACL permissions are saved to
.acllockfolder - Remove Inheritance - Inherited permissions are disabled
- Grant Administrators - Ensure admin access is preserved
- Deny Everyone - Block all other users from accessing
- Remove Deny Rule - Remove the "Everyone" deny rule
- Restore Inheritance - Re-enable permission inheritance
- Restore from Backup - Optionally restore original permissions
acllock lock "C:\Projects\ClientData" -Note "Client confidential - Q1 2024"acllock status "C:\Projects\ClientData"Output:
Status for: C:\Projects\ClientData
π Status: LOCKED
π Access: No
πΎ Backup exists
Created: 2024-01-15 14:30:22
By: umang@DESKTOP-PC
Note: Client confidential - Q1 2024
acllock unlock "C:\Projects\ClientData"# Batch lock multiple folders
$folders = @(
"C:\Data\Project1",
"C:\Data\Project2",
"C:\Data\Project3"
)
foreach ($folder in $folders) {
acllock lock $folder -Force -Note "End of quarter lockdown"
}If you get locked out or need to bypass acllock, run as Administrator:
takeown /f "C:\LockedPath" /r /d y
icacls "C:\LockedPath" /reset /tThis will:
- Take ownership of the path
- Reset all permissions to defaults
- Restore full access
| Command | Description |
|---|---|
lock <path> |
Lock file or folder |
unlock <path> |
Unlock file or folder |
status <path> |
Check lock status |
backup <path> |
Backup ACL permissions |
restore <path> |
Restore ACL from backup |
tui |
Launch interactive TUI |
help |
Show help |
version |
Show version |
| Option | Description |
|---|---|
-Recursive |
Apply to subdirectories |
-DryRun |
Preview changes only |
-Force |
Skip confirmations |
-Json |
Output as JSON |
-Verbose |
Show detailed output |
-Note <text> |
Add note/reason |
acllock/
βββ acllock.ps1 # Main entry point
βββ acllock.cmd # CMD wrapper
βββ install.ps1 # Installer script
βββ core/
β βββ acl.ps1 # ACL operations
β βββ validate.ps1 # Path validation
β βββ state.ps1 # State management
β βββ backup.ps1 # Backup/restore
β βββ logger.ps1 # Logging utilities
βββ ui/
βββ tui.ps1 # TUI main
βββ draw.ps1 # UI rendering
acllock automatically creates backups before locking:
- Location:
.acllockfolder next to locked path - Format: JSON with full ACL details
- Metadata: Timestamp, user, computer, notes
- Recovery: Use
restorecommand or manual JSON inspection
Example backup structure:
C:\Projects\
βββ ClientData\ (locked folder)
βββ .acllock\
βββ ClientData.acl.backup
All operations are logged to:
%LOCALAPPDATA%\acllock\acllock.log
Log format:
[2024-01-15 14:30:22] [INFO] Locking: C:\Projects\ClientData
[2024-01-15 14:30:23] [SUCCESS] Path locked successfully
β DO:
- Always run as Administrator for lock/unlock
- Use
-DryRunto preview changes on critical paths - Add descriptive notes to track why something is locked
- Keep backups of the
.acllockfolders - Test recovery procedures before locking critical data
β DON'T:
- Lock system directories without careful consideration
- Lock files that are currently in use
- Rely on this for cryptographic security
- Delete
.acllockbackup folders - Lock the acllock installation directory
Run PowerShell as Administrator
acllock only works on NTFS. FAT32, exFAT, and network shares are not supported.
The path may be in use. Close programs using it and try again.
The wrapper uses -NoProfile to avoid this. If still slow, check your PowerShell configuration.
Future improvements:
- Recursive locking with exclusion patterns
- Time-based auto-unlock
- Password-protected unlock
- Per-user ACL targeting
- WinGet package distribution
- Rust rewrite (optional, for performance)
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Test thoroughly on Windows
- Submit a pull request
MIT License - see LICENSE file for details
Created for ethical hackers, developers, and security researchers who need quick ACL-based file protection on Windows.
This tool modifies NTFS permissions. While designed with safety in mind (automatic backups, administrator access preservation), always:
- Test on non-critical data first
- Maintain backups of important files
- Understand emergency recovery procedures
- Use responsibly and ethically
Remember: acllock is permission-based, not encryption. For true security, use proper encryption tools like BitLocker, VeraCrypt, or 7-Zip with passwords.