cls
@ECHO OFF
title Folder Locker
if 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%==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:
Posts
I want to question it's purpose and efficacy... using random system folder GUIDs is a bit sketch and I can't find any real documentation for this one, so who knows what holes or problems might crop up from using it. There's probably a better way to achieve the goal here than his.
fuck up once and you break your thumb / if you're happy at all then you're god damn dumb
that's right we're on a fucked up cruise / God is dead but at least we have booze
bad things happen, no one knows why / the sun burns out and everyone dies
There are better ways to accomplish this (a zip file with a password for instance).
I HAVE BEEN SUMMONED
Yes, and they will always be a thing when you have a batch job you want to run consistently and you don't have need for a batch scheduler.
studying it further, the password doesn't even do anything to the files themselves
the folder is 'locked' by renaming it and marking it as system/hidden to match some defined windows system value, presumedly making it so the windows file explorer won't actually open or see it
the password just blocks you from using the script to undo that naming and marking
even if you never looked into the batch script all you'd need to do is run the two commands:
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" Locker
so yeah this script isn't so much locking a file cabinet as it is taking your files and putting them in the microwave
fuck up once and you break your thumb / if you're happy at all then you're god damn dumb
that's right we're on a fucked up cruise / God is dead but at least we have booze
bad things happen, no one knows why / the sun burns out and everyone dies
The BAT is at least 11 years old.
A cursory google suggests that the trick it's using, turning the folder into a link to the control panel, is older still, and I'm curious if it still works.
(That thread suggests a win7 update)