Your best source of information and news about winvista, hardware and xp on the internet

Vista ARTICLES TOP 50 Spyware Virus Vista SOFT Vista HELP

Password Protect Your Folder Without Using Any Software


The best part is that you don’t need any special software to do this. Just plain old Notepad is all that you need.

Here is the code that you need:

cls
@ECHO OFF
title Folder Personal
if EXIST “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}” goto UNLOCK
if NOT EXIST Personal 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 Personal “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%==pwd123 HERE goto FAIL
attrib -h -s “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}”
ren “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}” Personal
echo Folder Unlocked successfully
goto End
:FAIL
echo Invalid password
goto end
:MDLOCKER
md Personal
echo Personal created successfully
goto End
:End

Now here is what you need to do:

Just copy the above code and paste it into Notepad. Save it by giving it any name you choose. Assuming, the file is called secret.txt, change the extension to ‘.bat‘ so that the new name becomes secret.bat. What you get is a batch file. You could actually save one step by saving the file in Notepad directly as secret.bat by enclosing the file name like this: “secret.bat” . This batch file is the one that you need. You can edit this batch file to change the folder name and the password. To change the name of the folder that is created, change the ‘Personal’ (in bold in the above code) to any another name you choose. Likewise change the ‘pwd123? (in red in the code) to anything else.

Now let’s see how to use it. Place the file in the location where you would like to create your protected folder. Run the batch file by double clicking on it. This will create a folder named Personal in the same location as the batch file. You can now open this folder and place any files in it. Once you are finished, run the batch file again. You will be asked whether you want to lock the folder. Entry ‘Y’ (for Yes) and hit Enter. The folder becomes invisible. To retrieve the folder, run the batch file again. You will be prompted to enter the password. Enter the password, hit enter and voila! the folder appears.

Important: The batch file acts like a key to open the locked folder. So once you have created and locked a folder, do not keep the batch file in the same location since anybody can open the batch file and view your password. So I would suggest that you keep the batch file in a separate and safe place or better still keep it on your pen drive or flash drive. That way when you want to open the folder just copy the batch file to the location where you have your protected folder and run it.

Do remember that the above method is not intended to act as a substitute for the numerous free and commercial softwares that are specifically designed to provide security and encryption to your data.

Update: One of my friend told me that the code does is not working. Of course I did check it before posting it here. But I have identified the problem. The problem is with the straight double quotes used in the code in this post. Once you copy the code you would also need to change each of the double quotes with your keyboard double quotes. That might seem a lot of work for some. So I thought it would be easier to give away the batch file itself. You can download the file here. (Use right-click and ‘Save Target as’ or ‘Save Link as’).

Popularity: 1%


Written by magakos. Read more great feeds at is source WEBSITE
23 comments.
Read more articles on Windows Hacks and Solutions and otherSoftware and Tips and Windows.

Related articles

23 comments

Read the comments left by other users below, or:

Get your own gravatar by visiting gravatar.com Dan
#1. July 6th, 2008, at 7:24 PM.

Works for me. Thanks.

Get your own gravatar by visiting gravatar.com nikhil
#2. August 10th, 2008, at 2:04 PM.

hello sir/madam i used this trick and it was successful but now the problem is that i am unable to see the folder locker . so plz help me.

Get your own gravatar by visiting gravatar.com tom
#3. August 10th, 2008, at 5:31 PM.

Worked great once i’d swapped your “s for my “s. Thanks!

Get your own gravatar by visiting gravatar.com Brian
#4. September 8th, 2008, at 5:28 PM.

Thank you very much!
It worked perfectly for me after downloading the notepad file and replacing the “s.

Get your own gravatar by visiting gravatar.com Hien
#5. September 18th, 2008, at 11:56 PM.

Dear Editor,

It seems that i go to the place, all what i find that greats

Thank you so much!

Get your own gravatar by visiting gravatar.com tord
#6. September 23rd, 2008, at 9:32 AM.

pelao la sacaste del estadio, solo hay una cosita no podrias meterle
al codigo algo que evite que puedan borrar la carpeta o que se restablesca en su defecto si la borran

pero esta muy bueno…

Get your own gravatar by visiting gravatar.com vikas
#7. September 25th, 2008, at 7:11 AM.

this worksssss yaar thanks

Get your own gravatar by visiting gravatar.com munna
#8. November 3rd, 2008, at 6:38 AM.

hello ,
This is working but wat ever the code i enter its accepting how to solve this problem..

Thanks

Get your own gravatar by visiting gravatar.com Parveen Hooda
#9. November 7th, 2008, at 5:24 AM.

Dear sir
Can i use this process in windows xp sp2.

Get your own gravatar by visiting gravatar.com Hakim
#10. November 13th, 2008, at 11:42 PM.

It works! thanks!

Get your own gravatar by visiting gravatar.com adi
#11. December 17th, 2008, at 3:01 PM.

ok thank’s It works! in xp…
but can u help me.. i have try it in windows vista..
but i am sory it’s failed.. can u tell me why this file .bat did not work…
and how suppose to me to make this file .bat works in windows vista?
thx b4

Get your own gravatar by visiting gravatar.com satish
#12. January 6th, 2009, at 10:54 AM.

This works in windos vista
thanks……

Get your own gravatar by visiting gravatar.com iWill
#13. February 3rd, 2009, at 12:08 PM.

Funcionó a la perfección!!

Muchas gracias…

Get your own gravatar by visiting gravatar.com akki
#14. February 16th, 2009, at 5:46 AM.

Hey dude,

Its a good Code. I used it and it works just fine
but the problem is that when we run batch file for the third time to unlock the folder the password is visible, if any person sitting next to us can see the password. when we put the password it must be somthing like this “*******”or must be invisible.is there any other command for this?

Get your own gravatar by visiting gravatar.com prime
#15. March 9th, 2009, at 1:48 PM.

thanx dude…..
it worked!!
hats off….thanx once again!

Get your own gravatar by visiting gravatar.com Someone
#16. March 20th, 2009, at 3:37 AM.

Really good trick.. but it can still be opened when it has been locked.

If you go to Tools > Folder Options > View > Uncheck “Hide protected operating system files (Recommended)” > Click Yes > Click OK

Now a folder with a weird name will appear which is the same folder you are locking/unlocking

Otherwise, great trick .. and thanks!!

Get your own gravatar by visiting gravatar.com Someone
#17. March 20th, 2009, at 3:40 AM.

Really good trick.. but it can still be opened when it has been locked.

If you go to Tools > Folder Options > View > Uncheck “Hide protected operating system files (Recommended)” and check > Click Yes > Check “Show hidden files and folders” > Click OK

Now a folder with a weird name will appear which is the same folder you are locking/unlocking

Otherwise, great trick .. and thanks!!

Get your own gravatar by visiting gravatar.com philip
#18. April 2nd, 2009, at 1:29 PM.

i did everything as you said and it worked at first
but know the folder doesn’t apear when i write the password
you must help me the folder was very important
fortunately i found the folder with that last comment but if you can tell me what to do instead i would appreciate it

thanks

Get your own gravatar by visiting gravatar.com Manuloko
#19. April 3rd, 2009, at 6:07 PM.

Quisiera saber como puedo hacer para que cuando me pida la contraseña no se mire lo que escribo eso me seria de mucha ayuda

Gracias

Get your own gravatar by visiting gravatar.com varke
#20. April 18th, 2009, at 4:46 AM.

hi i used the link he gave you and it all worked the folder disapeared and all but i dont know what the pass is now

Get your own gravatar by visiting gravatar.com adolf_hitler_jr
#21. April 28th, 2009, at 10:35 AM.

the code didn’t work for me not until i added few commands. i also removed the attrib command to make it more realistic (to make control panel icon visible). To make the password more secure, i downloaded a bat to exe converter. it’s very simple to use.

cls
@ECHO OFF
title Folder Personal
if EXIST “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}” goto UNLOCK else LOCK
if NOT EXIST Personal 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 Personal “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%==pwd123 HERE goto FAIL
ren “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}” Personal
echo Folder Unlocked successfully
goto End

:FAIL
echo Invalid password
goto end

:MDLOCKER
md Personal
echo Personal created successfully
goto End
:End

Get your own gravatar by visiting gravatar.com fharen
#22. August 25th, 2009, at 2:52 PM.

help?
it makes a folder when i first click the .bat file but if I click it again (supposed to be hidding the folder) the folder is still there and a file with “ö” name appears. I’m using windows vista.

Get your own gravatar by visiting gravatar.com Atin Agarwal
#23. September 14th, 2009, at 12:05 PM.

Hats Off To The Guy Who Created It. I Am ATIN KUMAR AGARWAL. I Live In Haldwani, Uttrakhand, INDIA. I Am In Class 12th Right Now.
( Today’s Date Is 14th September,2009)
Man It Works For Win XP SP2 . Obviously Some Correction Are Needed. I Have Solved The Password Issue Also. From The Code I Am Giving Below The Password Will Be : “pwd123?
Without Any Space And Double Quotes.Now The Code Is Absolutely Fine . Below Is The Exact Code Required .It Works Without Any Editing. Just Copy And Save It In Any File With Extention *.BAT . Remember Your Current Password Will Be “pwd123? . You Can Change It Later On If You Don’t Like The Current One. Just Find The Letters “pwd123? In The Code Below And Replace Only “pwd123? With The Desired Password.
Thanks For Reading My Shit. Now Here Is The Code :

cls
@ECHO OFF
title Folder Personal
if EXIST “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}” goto UNLOCK else LOCK
if NOT EXIST Personal 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 Personal “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%==pwd123 goto FAIL
ren “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}” Personal
echo Folder Unlocked successfully
goto End

:FAIL
echo Invalid password
goto end

:MDLOCKER
md Personal
echo Personal created successfully
goto End
:End

Leave your comment...

If you want to leave your comment on this article, simply fill out the next form:




You can use these XHTML tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong> .