Sometime our friends and family member use our personal computer, laptop but in some cases we should hide our files and folder from them such as private photo, video etc. we want to hide it but we don’t want install any file locker software because if they saw file locker software then they will suck you and the software costs. So it’s a time to lock any folder without any software.
My friend coded a simple but powerfull batch file that will help you to lock folder with password. All credit goes to my friend Ramesh for his wonderful work. Copy all code given below, paste it in notepad and save is as yourname.bat. tricnp1234 is your default password you can change it in code just replace tricnp1234 with New password. Put your all private files inside private_folder. And remember you should always exit this tool with its option otherwise it will create few un-necessary files.
SET password=tricnp1234
SET echonp=index.vbs
SET startprg=start.vbs
SET aiwrong=wrong.vbs
SET pass=pass.vbs
MODE 60, 30
COLOR 0A
@ECHO OFF
CLS
title Folder private_folder
IF EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" GOTO AIindex
IF NOT EXIST private_folder GOTO MKFILE
CLS
:MKFILE
MD private_folder
ECHO REQUIRED ITEMS CREATED
GOTO AIindex
:AIindex
ECHO CreateObject("SAPI.SpVoice").Speak" Hello %USERNAME%">%echonp%
ECHO CreateObject("SAPI.SpVoice").Speak" Do you want to unlock your file?">%echonp%
ECHO CreateObject("SAPI.SpVoice").Speak" wrong">%aiwrong%
ECHO CreateObject("SAPI.SpVoice").Speak" Program Starting">%startprg%
ECHO CreateObject("SAPI.SpVoice").Speak" Please select the number">%startprg%
ECHO CreateObject("SAPI.SpVoice").Speak" %USERNAME%, WRONG PASSWORD.">%pass%
CLS
GOTO START
:START
START %echonp%
ECHO.
ECHO.
ECHO.
ECHO.
ECHO \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
ECHO.\\ \\
ECHO. \\ F I L E L O C K E R \\
ECHO. \\ \\
ECHO. \\ - By : Ramesh \\
ECHO. \\ ```````````````````````````````````````````
ECHO.
ECHO.
ECHO Welcome Mate!
ECHO.
ECHO.
ECHO - ENJOY Mate
ECHO.
ECHO [Please hit enter to continue]
PAUSE >nul
CLS
GOTO MAIN
:MAIN
CLS
START %startprg%
ECHO Hey %USERNAME% What you want to do?
ECHO.
ECHO.
ECHO 1. I want to access or lock my file
ECHO 2. Nothing much... Bye
ECHO.
ECHO.
ECHO.
ECHO [ PRESSS ENTER TO EXIT ]
ECHO.
SET /P "usrchoice=Please Pick an option to navigate : "
GOTO CHOICE
:CHOICE
IF %usrchoice%==1 GOTO START
IF %usrchoice%==2 GOTO EXIT
GOTO REPROMPT
:REPROMPT
START %aiwrong%
SET /P "usrchoice=Please pick a number given above : "
GOTO CHOICE
:START
SET /P "passcheck=Please enter your correct password : "
GOTO VALIDATE
:VALIDATE
IF NOT %passcheck%==%password% GOTO ERROR
CLS
ECHO.
ECHO.
ECHO True Password
ECHO.
ECHO [Hit enter to continue.]
PAUSE>nul
CLS
:INTASK
ECHO What do you want to do
ECHO 1. Unlock your folder
ECHO 2. Lock your folder
ECHO.
ECHO.
ECHO 3. Exit
ECHO.
ECHO.
ECHO.
ECHO.
SET /P "usrtask=Type your choice here : "
GOTO INTASK2
:INTASK2
IF %usrtask%==1 GOTO LOCK
IF %usrtask%==2 GOTO UNLOCK
IF %usrtask%==3 GOTO EXIT
GOTO INTASK
:LOCK
ECHO.
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" private_folder
ECHO FOLDER UNLOCKED
PAUSE >nul
CLS
GOTO INTASK
:UNLOCK
ECHO.
ren private_folder "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ECHO FOLDER LOCKED
PAUSE >nul
CLS
GOTO INTASK
:ERROR
ECHO WRONG PASSWORD
GOTO REENTERCREDENTIALS
:REENTERCREDENTIALS
SET /P "proceed=Do you want to try again? type Y for Yes and N for No "
IF %proceed%==Y GOTO RETRY
IF %proceed%==y GOTO RETRY
IF %proceed%==N GOTO EOF
IF %proceed%==n GOTO EOF
GOTO REENTERCREDENTIALS
:RETRY
START %pass%
SET /P "passcheck=Please re-enter your password : "
GOTO VALIDATE
:EXIT
CLS
ECHO.
ECHO.
ECHO Okay, bye!
ECHO. Press any key to exit!
ECHO.
ECHO.
ECHO.
ECHO.
PAUSE >nul
GOTO EOF
:EOF
DEL %echonp%
DEL %startprg%
DEL %aiwrong%
DEL %pass%
EXIT
Thanks for reading and feel free to comment below.
March 08, 2016
Tags :
computer
,
folder lock
,
windows
Subscribe by Email
Follow Updates Articles from This Blog via Email
No Comments