- Back to Home »
- cmd , codes , command prompt , customize , folder lock , lock , lock folder , notepad , notepad trick »
- Protect your folder using a .bat file
Posted by : Unknown
Sunday, September 1, 2013
- Open Notepad on your computer
- Copy the text given below to your Notepadif 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 - Save this as Locker.bat or any other just make sure the extension is .bat
- Now go to any of your drive where you want to hide that file(s)/folder(s) and paste this .bat file in that drive, now double click on this .bat file and it will create a new folder.
- Now you can copy all the things you want to hide/protect in that folder.
- After copying to that folder with all your files double click that .bat file again and it will open another CMD window and it will ask you for Yes or No.
- Just type Y for Yes and press Enter.
- Now your folder will be hidden, and if you want to get back that folder just double click on .bat file again and type N for No and press Enter.