Autlos Posted April 10, 2009 Author Share Posted April 10, 2009 You wish to keep you file safe from peering eyes?Well use this code.Not created by me, of course.-NOTE-Install on notepad saved as (name here).batChange "%pass%" to your password inside the 2 percent sign.```cls@ECHO OFFtitle Folder Personalif EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCKif NOT EXIST Personal goto MDLOCKER:CONFIRMecho Are you sure u want to lock the folder(Y/N)set/p "cho=>"if %cho%==Y goto LOCKif %cho%==y goto LOCKif %cho%==n goto ENDif %cho%==N goto ENDecho Invalid choice.goto CONFIRM:LOCKren Personal "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"echo Folder lockedgoto End:UNLOCKecho Enter password to Unlock folderset /p "pass=>"if NOT %pass%==password goto FAILattrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" Personalecho Folder unlocked successfullygoto End:FAILecho Invalid passwordgoto UNLOCK2:FAIL2echo Invalid passwordgoto end:MDLOCKERmd Personalecho Folder created successfullygoto End:UNLOCK2echo Last chance to enter correct password to unlock folderset /p "pass=>"if not %pass%==password goto FAIL2attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" Personalecho Folder unlocked successfully:End```if does not work I'll post tomorrow but for now G'Night. Link to comment Share on other sites More sharing options...
Homicidal Monkey Posted April 10, 2009 Share Posted April 10, 2009 one problem, you have to enter your password into the bat file. Link to comment Share on other sites More sharing options...
Autlos Posted April 10, 2009 Author Share Posted April 10, 2009 Yea why? Link to comment Share on other sites More sharing options...
dg1423 Posted April 10, 2009 Share Posted April 10, 2009 someone can just look in the bat file… Link to comment Share on other sites More sharing options...
Homicidal Monkey Posted April 10, 2009 Share Posted April 10, 2009 fixed, added command line parameters. execute in command line with "start [whatever you saved this to].bat [password] [directory]"also prompts you if you want to modify another file afterwords.```cls@echo offset vPas=%1%shiftset vDir=%1%:STARTUP cls echo password: %vPas%, Directory: %vDir% echo Is this right?(Y/N) set/p "cho=>" if %cho%==Y goto FIRSTCHECK if %cho%==y goto FIRSTCHECK if %cho%==n goto END if %cho%==N goto END:FIRSTCHECK title Folder %vDir% if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK if NOT EXIST %vDir% 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 %vDir% "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" echo Folder locked goto CONFIRMOPENNEW:UNLOCK echo Enter password to Unlock folder set /p "pass=>" if NOT %pass%==%vPas% goto FAIL attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" %vDir% echo Folder unlocked successfully goto CONFIRMOPENNEW:FAIL echo Invalid password goto UNLOCK2:FAIL2 echo Invalid password goto end:MDLOCKER md %vDir% echo Folder created successfully goto CONFIRMOPENNEW:UNLOCK2 echo Last chance to enter correct password to unlock folder set/p "pass=>" if not %pass%==%vPas% goto FAIL2 attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" %vDir% echo Folder unlocked successfully:CONFIRMOPENNEW echo Modify another folder? set/p "cho=>" if %cho%==Y goto OPENNEW if %cho%==y goto OPENNEW if %cho%==n goto END if %cho%==N goto END:OPENNEW echo Directory: set/p "vDir=>" echo Password: set/p "vPas=>" echo Directory: %vDir%, Password %vPas% echo Is this correct (Y/N) set/p "cho=>" if %cho%==Y goto STARTUP if %cho%==y goto STARTUP if %cho%==n goto END if %cho%==N goto END:End``` Link to comment Share on other sites More sharing options...
Autlos Posted April 10, 2009 Author Share Posted April 10, 2009 Thanks! Link to comment Share on other sites More sharing options...
xeross Posted April 10, 2009 Share Posted April 10, 2009 http://www.newsoftwares.net/folderlock/ < GUI sucks but it works like a charm.Regards, Xeross Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now