LOKEY V1.0 (portable Version)

Introduction: LOKEY V1.0 (portable Version)

About: Full time Technical Support Associate. Part time Web-Designer & Developer. What's left I spend trying to make stuff.

There have been many batch files that let you password protect a folder, I even made a few to use. But the problem with all of them is that anyone who has access to that batch file can right click on it and see the password written in it.
So after many hours of thinking I came up with a solution, "REMOVE the PASSWORD from the batch file".
And the result was LOKEY v1.0, it has the following advantages over other batch file:
1) The password is not stored in the batch file.
2) You can create as many secret folders as you want.
3) You can use it from any directory.

So lets see how it's made.

Step 1: How It Works

Step 1. Place it anywhere on your PC.
Step 2. Double click on it.
Step 3. Enter a to create a Folder, b to hide an existing folder or c to unhide an existing folder.
Step 4. Enter a folder name and password.
Step 5. Enter.

Since you guys are making batch files, I assume that you can fully understand the code and it's working.
It is like my other batch codes really simple, since I don't know much about anything.

So next is the code, use it and comment about any problems or any changes that you might have made.

Step 2: Code Goes Here

Copy and paste the following lines in Notepad and save it as anything.bat


@echo off
title LOKEY v1.0
:top
cls
echo.
echo LOKEY v1.0
echo Password Protect your files and folders the easy way
echo.
echo.
echo (cc) BY-NC-SA Copyrighted under Creative Commons 2013, Tanmay Das
echo Attribution - NonCommercial - ShareAlike 3.0 Unported License.
echo Visit Instructable Page @ https://www.instructables.com/member/Tanmay Das
echo.
echo.
echo Welcome to LOKEY v1.0
echo.
echo Please select one of the options
echo A) Create a New Lokey Folder
echo B) Hide an Existing Lokey Folder
echo C) Open an Existing Lokey Folder
echo D) Exit
echo.
set /p opt= Your Option :
if /I %opt% == a goto create
if /I %opt% == b goto hide
if /I %opt% == c goto open
if /I %opt% == d goto end
echo.
echo This option DOES NOT EXIST
echo.
pause
goto top
:create
cls
echo.
echo Create a New Lokey Folder
echo.
set /p name= Enter an Unique Name :
md "%name%"
cd "%name%"
echo LOKEY v1.0 > log.txt
echo Password Protect your files and folders the easy way >> log.txt
echo. >> log.txt
echo Log File >> log.txt
echo Lokey Folder Created on %date% at %time% >> log.txt
cd..
cls
echo.
echo Successful....
echo A new Lokey Folder is Created named (%name%)
echo.
pause
goto top
:hide
cls
echo.
echo Hide an Existing Lokey Folder
echo.
set /p name1= Enter the FolderName :
set /p pass= Enter your Password :
if EXIST "%name1%" goto do1
cls
echo.
echo Sorry but the Folder you want to hide was NOT FOUND or DOES NOT EXISTS
:again1
echo.
set /p ask1= Do you want to create a New LokBox? (Y/N) :
if /I %ask1% == y goto create
if /I %ask1% == n goto top
echo.
echo This option DOES NOT EXIST
goto again1
:do1
cd "%name1%"
echo Lokey Folder hidden on %date% at %time% >> log.txt
cd..
move "%name1%" "C:\WINDOWS\%pass%%name1%"
attrib +h "C:\WINDOWS\%pass%%name1%"
cls
echo.
echo Successful....
echo Your Lokey Folder is Now Hidden
echo You can access your Lokey Folder with Name (%name1%) and Password (%pass%)
echo.
pause
goto top
:open
cls
echo.
echo Open an Existing Lokey Folder
echo.
set /p name2= Enter the FolderName :
set /p pass2= Enter your Password :
if EXIST "C:\WINDOWS\%pass2%%name2%" goto do2
cls
echo.
echo Sorry but Lokey FOlder with the given Name and Password was NOT FOUND
:again2
echo.
set /p ask2= Do you want to create a Lokey Folder? (Y/N) :
if /I %ask2% == y goto create
if /I %ask2% == n goto top
echo.
echo This option DOES NOT EXIST
goto again2
:do2
attrib -h "C:\WINDOWS\%pass2%%name2%"
move "C:\WINDOWS\%pass2%%name2%" "%name2%"
cd "%name2%"
echo Lokey Folder accessed on %date% at %time% >> log.txt
cd..
cls
echo.
echo Successful....
echo Your Lokey Folder is ready for use
echo.
pause
goto top
:end
cls
echo.
echo Exiting Lokey v1.0.... Thank You....
echo.
echo Created By Tanmay Das
echo.
pause
exit

Save it as anything.bat

Note. I've tested it in my XP. If you find some problem in finding the WINDOWS Folder, just change all the bold test with the path to that folder.
You can also change that path to any folder you want to keep the Lokey Folder in.

EDIT: Thank to Batchcc to suggest a change, the new script is a few lines smaller

Be the First to Share

    Recommendations

    • Game Design: Student Design Challenge

      Game Design: Student Design Challenge
    • Make It Bridge

      Make It Bridge
    • Big and Small Contest

      Big and Small Contest

    7 Comments

    0
    Batchcc
    Batchcc

    7 years ago

    Tan may using

    if %ask1% == y goto create
    if %ask1% == Y goto create
    if %ask1% == n goto top
    if %ask1% == N goto top

    Is inefficient you can reduce this to 2 lines by using if /I which is not case sensitive so the user can input y or Y and it will be interpreted the same way.

    https://www.instructables.com/member/batchcc

    :)

    0
    Tanmay Das
    Tanmay Das

    Reply 7 years ago

    Thanks for the suggestion. I've made the changes and it is a few lines smaller.

    0
    Tanmay Das
    Tanmay Das

    9 years ago on Introduction

    Creative Commons. When you work hard on something, you have to try to make sure you get some credit.

    0
    Tanmay Das
    Tanmay Das

    9 years ago on Introduction

    Creative Commons. When you work hard on something, you have to try to make sure you get some credit.

    0
    darman12
    darman12

    9 years ago on Introduction

    Cool batch file! it is a neat solution. You know a lot more than I do about batch files. I have a suggestion. Modify the batch file so that it creates a Lokey Folder in the directory that is executed in.

    I would be happy to add your Instructable to my group; I would just like it if you added a little bit about what a batch file is and how this one works because my group is for those who don't know a whole lot about computers.

    0
    Tanmay Das
    Tanmay Das

    Reply 9 years ago on Introduction

    Thanks for your support, sure I'll like if you add my instructable in your group. That's why I posted it here.
    As per the Lokey folder, if anyone can get their hands on the code in the batch file then they can know the name of the folder and search for the folder named Lokey as the folder is only hidden and could be found.
    So the above code, uses the username and password as the foldername.

    But feel free to edit it as you like.
    Now I think I shall work on v2.0. Will keep all posted.

    0
    darman12
    darman12

    Reply 9 years ago on Introduction

    I added it. I'll try out the code sometime in the next couple of days. I'll let you know if I find a pny issues you can debug. Is your code really copyrighted?