
Lock a Folder in Windows XP
Why?
Say you have some files you don't want anyone to see, and that you dont want to install a third party program to hide them. Just follow these instructions, and you can have a simple way of totally hiding a folder.
Instructions
- Copy the text at the bottom of the page and save it as a .txt file, inside the folder you want to lock.
- Open it in Notepad, and locate Line 23. Change "password" to whatever you want the password to be. Save the file.
- Change the extension of the file from .txt to .bat, then double-click and open the file.
- It will create a subfolder called "Private". Move any files you want kept private there.
- Once you've moved the files, double-click the .bat file again. Answer "y" when it asks you, and the file will disappear.
- If you want to see the files again, simply double-click on the .bat file, and type in your password.
- Hey Presto! Your files reappear!
Notes
- If you don't know how to change the extension of the file, or if you can't see ".txt" anywhere in the name of the file, you'll need to make a small option change. Go to Tools -> Folder Options -> View -> Hide Extensions for Known File Types and uncheck that box. Once that's done, the name of the file will change from "lockfolder" to "lockfolder.txt", and then change the .txt to .bat. Of course, you probably know this already, but it's just explained for those who don't.
- There really is no way to get to the files once they've been locked save for knowing the password. I mean, the CIA will use something better, but for home or small business use, it's great.
- I can almost hear you now. "Woah!", you cry! You can just see the password by opening the .bat file in notepad, it's not secure at all. There's a simple solution. Delete the .bat file once the folder is locked. Then, re-create it when you need to unlock it. Perhaps you store the .bat file in a different location, or on a memory stick, or in your email, or you can just come back to this page, and re-download it, it's only a tiny little text file.
- OK, so it's not 100% secure, but it's damn good. It's a great way of hiding files on your hard disk from parents, snoopers or other laymen, although you won't fool the police or FBI or anyone with this.
The Code
cls
@ECHO OFF
title Folder Private
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
if NOT EXIST Private goto MDLOCKER
:CONFIRM
echo Are you sure you 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 Private "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%== password goto FAIL
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" Private
echo Folder Unlocked successfully
goto End
:FAIL
echo Invalid password
goto end
:MDLOCKER
md Private
echo Private created successfully
goto End
:End