# Folder Lock without any S/W



## DNA_Uncut (Dec 8, 2006)

Folder Lock without any S/W

Many people have been looking for an alternative way to lock Folders without the use of any alternative software. So, here you go.

Open Notepad and copy the below code and save as locker.bat. Please don't forget to change your password in the code it's shown the place where to type your password. 
Now double click on locker .bat 
First time start, it will create folder with Locker automatically for u. After creation of the Locker folder, place the contents u want to lock inside the Locker Folder and run locker.bat again.

I hope this comes in handy 

___________________________________________________________

Code:

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


----------



## dez_666 (May 30, 2007)

Sorry to question your batch, but doesnt this just make the file into a system and hidden folder?


----------



## JohnWill (Oct 19, 2002)

Not much of a lock.


----------



## WhitPhil (Oct 4, 2000)

Well, it would appear to be a little more complex than that.

The folder "locker" is created, then when the bat file is run again, it is renamed to Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D} and then the H&S attributes applied.

The unlocking process is the reverse.

But, I don't understand and hopefully DNA_Uncut will expalin, is what DOS is really doing when the Control Panel CLSID is used as a filename (from the file system point of view) and what affect this has on Control Panel itself.

**
This trick seems to be on the web already. The addition here was the PW. But again, I haven't found whether the CLSID of Control Panel is important or whether any old CLSID would work.


----------



## dez_666 (May 30, 2007)

Hey Whitphil you seem to know alot about those CLSID things. Could you reference me to a site or explain to me what those are and how they work  Ive always wondered why i see so many xD


----------



## WhitPhil (Oct 4, 2000)

I don't claim to be an expert on CLSIDs but the following sites give decent explanations.

CLSID1

Wikipedia


----------



## aarhus2004 (Jan 10, 2004)

DNA_Uncut said:


> Folder Lock without any S/W
> 
> Open Notepad and copy the below code and save as locker.bat. Please don't forget to change your password in the code it's shown the place where to type your password.
> Now double click on locker .bat
> ...


Hello,

Clearly I am doing something incorrectly.

The folder 'Locker' appears on the first click of the .bat
I insert another folder and click the .bat again. No lock occurs.

This all on Desktop.

1. Do I need the word Code: at the the head of the batch file?

2. See GIF 'Locker' showing results of clicking on the .bat file which created the folder 'Locker' and the attempt to lock the folder.

3. See GIF 'PassW' for my password insertion.

Help appreciated.

Ben.


----------



## dez_666 (May 30, 2007)

It could be that the script and its commands are not compatible with your version of windows :[


----------



## aarhus2004 (Jan 10, 2004)

dez_666 said:


> It could be that the script and its commands are not compatible with your version of windows :[


dez_666, but DOS is DOS no? Did you try it? What system have you?

Ben


----------



## dez_666 (May 30, 2007)

I didnt try it, and I dont care to try it, and I have windows XP. There are differences between the windows operating system, and DOS is DOS but XP does not have DOS.

DOS is 'Disk Operating System', which I dont have. maybe you are referring to Command prompt/processor?

=]


----------



## WhitPhil (Oct 4, 2000)

"I insert another folder and click the .bat again. No lock occurs."

Can you explain exactly what you did?

I "think" the file has to be run using the folder name "Locker". 

It creates it so that it can be seen, and you can move files into it. Then, when you run it again, it changes the name to the CLSID combination so that it can't be seen. Then, if you run it again, it will rename the CLSID combo back to "Locker" so that it can be seen again.

And, XP does have a DOS emulator!


----------



## dez_666 (May 30, 2007)

It does..?

Anyways that doesnt mean I was using it.


----------



## aarhus2004 (Jan 10, 2004)

WhitPhil said:


> "I insert another folder and click the .bat again. No lock occurs."
> 
> *Can you explain exactly what you did?*
> 
> ...


Hello WhiPhil,

With the Locker.bat file on the desktop I clicked it. A 'Locker' folder appeared on my desktop.I placed a folder in it - a nothing folder of no consequence. I clicked on the Locker.bat file again and all that happed is what my GIF showed - the DOS i.e. The Locker folder remained visible & unlocked - i.e. it opened to a click.

Any help?

Ben.


----------



## WhitPhil (Oct 4, 2000)

dez_666 said:


> It does..?


Well, whatever you wish to call CMD.exe.

Batch Files are processed by this "emulator" / "interpretter".


----------



## dez_666 (May 30, 2007)

From the page you linked -



> The command shell executes programs and displays their output on the screen by using individual characters similar to the MS-DOS command interpreter Command.com


They are not the same. As stated by microsoft, they are '_similar_'.


----------



## WhitPhil (Oct 4, 2000)

dez_666 said:


> They are not the same.


I think you are taking the "similar" out of context, but regardless, no where did I state that XP had something that was the SAME as native DOS. Hence my terminology, emulator/interpretter.
And, the commands that XP can "interpret" do not cover the entire array of DOS commands.

*Ben*
I'm not sure what the "bad command" actually is.

BUT, if you are interested you can do some batch file debugging.

First, take off the "Echo Off" and then put PAUSE statements in various places.

Removing the Echo Off will cause all commands to be displayed.
And the PAUSE will stop the batch file so that you can see what is happening.

Definitely put one at the very end so that the output stays on the screen, and initially this may be enough to see where the Bad Command is coming from.


----------



## aarhus2004 (Jan 10, 2004)

Thanks, Phil, for the suggestion. I will try it. 

I had already tried putting the batch file on C: and using a Run command from/in Minimal Boot. A:\> C: C:\> run locker.bat - something ran alright, but so fast I couldn't see/do a thing!

No harm done, just the familiar sense of mystery.

Cheers.

Ben.


----------



## aarhus2004 (Jan 10, 2004)

Hello,

By playing with the batch file (as suggested by WhitPhil) I was able to change the folder created and named 'Locked' to a folder named 'Control Panel' (with the appropriate MS Logo on it) and the rubbish folders I had placed in the folder 'Locked' were not visible in this. The CPanel list was visible.

I wasn't able to unlock it. At which point I gave up since I prefer the folder-locker freeware I have found. See my "For WinME Users Only" thread.* Here*.

I think there must be something wrong with the Code as given by DNA_Uncut.

Best I can do.

Ben.


----------



## DNA_Uncut (Dec 8, 2006)

aarhus2004 said:


> Hello,
> 
> By playing with the batch file (as suggested by WhitPhil) I was able to change the folder created and named 'Locked' to a folder named 'Control Panel' (with the appropriate MS Logo on it) and the rubbish folders I had placed in the folder 'Locked' were not visible in this. The CPanel list was visible.
> 
> ...


@aarhus2004

Sorry mate for the late reply. There is nothing wrong in my code and what you have done is also right. But check your OS if it is xp it should work for you. This script was released on 15th of this Month. And till date i am getting positive replies from the people who tried it. I shared this with more than 10k people. This is safer way to lock your folder. ( I do agree that this is not a safest one) But for home computers this is sufficient to hide files.


----------



## aarhus2004 (Jan 10, 2004)

DNA_Uncut said:


> @aarhus2004
> 
> Sorry mate for the late reply. There is nothing wrong in my code and what you have done is also right. *But check your OS if it is xp it should work for you*. This script was released on 15th of this Month. And till date i am getting positive replies from the people who tried it. I shared this with more than 10k people. This is safer way to lock your folder. ( I do agree that this is not a safest one) But for home computers this is sufficient to hide files.


Hello DNA_Uncut,

That is perhaps the reason. And my lack of experience with code is why I couldn't get it to unlock.

I hope someone using XP will have some input. And presumably you are using it.

Thanks.

Ben.


----------



## salcano (Apr 6, 2007)

thanks worked 100% use this alot


----------



## Guest (Sep 15, 2008)

WhitPhil said:


> But, I don't understand and hopefully DNA_Uncut will expalin, is what DOS is really doing when the Control Panel CLSID is used as a filename (from the file system point of view) and what affect this has on Control Panel itself.


As I understand it CLSID [Class IDs] are system registers usually stored in the registry, they can also be used as flags. When you install some programs flags are created to show installed it, the CLASSID is registered and when you uninstall programs especially trials or demos they usually remain so when you reinstall them they know they where on your system before.

I would assume the CLSID which in this case is a Control panel CLSID** simply flags that the locker has been run before an extra verification incase it tries to run on a folder that already exists but wasn't a locked folder however this verification isn't actually used so I'm guessing this code came from a larger batch file that has been watered down.

**Signfied by the '21EC2020' identifier if anyone gets bored enough go look through your registry you will find control panel applications all start with '21EC2020'


----------



## LauraMJ (Mar 18, 2004)

I ran the file, and it works on my system as described. 

Running XP Pro.


----------

