Folder Locking Without Software

Ever wanted to hide some important files on your PC? Here is a quick, no software install way of doing it!

Open Notepad or any other text editor. Copy the code below and save as locker.bat. Don’t forget to change the password (the field in red). Open locker.bat, it will create a folder called Private. Put the files that you need to hide in this folder. Run locker.bat again, and confirm.

When you want to access the folder, just run locker.bat and enter the password. Run it again to hide it.

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 here 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

Enjoy!

11 Comments so far

Skip to comment form

Bobby September 24th, 2007 at 2:12 am
(Quote)

Bobby

This was cool, the only other thing is that someone can see the password inside the batfile, can I convert it to a exe or something?

Brendan September 24th, 2007 at 4:39 am
(Quote)

Brendan

Bobby,

You could pass a variable from the command prompt, eg:

locker.bat yourpasswordhere

rem out the two lines below :UNLOCK and replace the line that starts:

if NOT %pass%==

with:

if NOT %pass%==%1 goto FAIL

.. it’s not pretty, but that way you have to supply the password at the command line when you wish to use it.

Brendan September 24th, 2007 at 4:44 am
(Quote)

Brendan

Make that %1%, sorry.

guanako September 24th, 2007 at 5:19 pm
(Quote)

guanako

awesome! thanks! :twisted:

K September 24th, 2007 at 5:34 pm
(Quote)

K

guanako on September 24, 2007 at 5:19 pm said:

awesome! thanks! :twisted:

do i know u :O

HS September 25th, 2007 at 9:57 am
(Quote)

HS

Even if I can pass the password as parameter, if someone else can read the batch file, he can unlock the folder without entering any password.

2 simple steps:

attrib -h -s “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}”
ren “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}” Private

jason September 26th, 2007 at 8:14 am
(Quote)

jason

i just rename the file extention to a yourfile.jpg no one will think of opening it to notepad then when i want my hidden file back just rename file extention back to .bat

yatin October 24th, 2007 at 4:20 am
(Quote)

yatin

that awesome man.
keep it up
keep going :cool:

Devendra Chouhan November 14th, 2007 at 2:42 am
(Quote)

Devendra Chouhan

it is good & working for folder security.

GOOD. Try this.

asdf November 22nd, 2007 at 7:03 am
(Quote)

asdf

All this does is hide it…..

You can just goto view > hidden files and folders :P

Nimbus April 3rd, 2008 at 4:06 am
(Quote)

Nimbus

Whoever made this is a fucking genious.
It may not be bulletproof but the concept is absolutely brilliant.

And some nice additions as well…

Leave a comment

Keep it polite and on topic. Your email address will not be published. Basic Textile formatting is enabled.

You can use these tags:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>