Monday 6 August 2012

Creating your own Folder Locker in Windows Operating systems.

Wow..today I came to know how to write my own folder protector and safe guard my files with out using any software. I started my career in IT as a Software Instructor for teaching people as Computer fundamentals, DOS, MS-Office etc.

At that time I knew that DOS is Powerful and has the capacity to do many low level works but not had the idea that it can create a utility file for me when I am searching for a software to protect it from the guys who stoles the data.

here is the Bat file content.

MyFolderLocker.bat

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

Here the password is sudarsan123$, you can change the password as per your wish.

Lets go for a test:

Copy the bat file which you had created from the above content, now take it to the place where you want to hide the files.

Here create a folder name Sudarsan and store your files you want to protect . Now run the batch file by double clicking it.

For unlocking again , run the file it will ask for password and here i had used  sudarsan123$, once you provide the password correctly it will unlock the folder.


Happy Coding......

How to protect your data to be taken through usb in Windows 7 or Win XP

I came to notice few days back that some one is using my system and I found data loss as windows system are prone to data theft easily. so, followed a technique to stop it with out using any software.

There are three ways are there,

1. Make you Registry to protect in such a way that it should not write data into the USB drives

2. Use a .bat file that protect your files and folder with a password.

3. Use a folder locker/ PC Locker for this purpose.

Write Protect to the USB Drives:

Go to the Start menu --> Run---> type Regedit,
You will get the Windows Registry Editor.

Now search for the Following key:
    HKEY_LOCAL_MACHINE\System\ControlSet001\Control\StorageDevicePolicies

if the "StorageDevicePolicies" key is not found you can create a new one in HKEY_LOCAL_MACHINE\System\ControlSet001\Control


Now set the Key value to 1 in order to protect it from writing data to the USB Devices.

If you you want to copy data from you computer to usb devices it will not allow.

In order to write the data again to the USB devices you can chane this value to 0 again.



for Windows Xp Machines follow the above same procedure but you the registry key is:
HKEY_LOCAL_MACHINE\System\ControlSet001\Control\StorageDevicePolicies


Note: Just back up the registry before changing any thing so that if u do any thing wrong or the system goes unstable it can be restored.

Happy coding...