Sunday, 25 May 2014

Lock any Folder without Software (Folder locker):-

Lock any Folder without Software (Folder locker):-

The following batch script help you in locking up your folder with a
password, so the user who knows the right password can only be able to
access the folder, where others don't (Well this is not quite secure,
but can be useful in learning batch programming, because even a noob
can easily identify the password, or can access the folder without
using a password, there are a lot of ways to break it).

The batch file that is given below will create a directory named
'Locker', when it gets executed, then you may place whatever you wish
to place inside that directory, once done re-execute the same batch
file, then it will prompt you whether to lock the folder

press 'y' and hit enter, then the directory 'Locker' Disappears. In
order to make the directory re-appear again, you have to execute the
same batch file once again, then it will prompt you to enter the
password to unlock the folder, you have to enter the password as
'secret', since it is already mentioned by default in the program

Once the password is matched, then the folder becomes visible, so that
you can access the folder again.

So, what happens is that, the folder 'Locker' is set with the system
and hidden attribute, hence it becomes invisible, when the batch
program is executed again, it prompt for password, which is already
set as an
environment variable with a value 'secret', when the match is found,
the attribute is set to normal and the folder becomes visible and

Here is the snippet for the folder locker

@echo off
title Folder Locker
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
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.
ren Locker "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
echo Folder locked
goto End
echo Enter password to Unlock folder
set/p "pass=>"
if NOT %pass%== secret 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
echo Invalid password
goto end
md Locker
echo Locker created successfully
goto End