0% found this document useful (0 votes)
2K views1 page

If Exist "Control Panel. " Goto Unlock If

This document contains a batch script that locks and unlocks a folder on a system. It first checks if the folder is already locked, and if not creates a lock file. It then prompts the user to confirm locking the folder, and if confirmed renames the lock file to the folder name and sets attributes to hide and system file. To unlock, it prompts for a password and if correct removes the attributes and renames the file back to the lock file name.

Uploaded by

imran200389
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2K views1 page

If Exist "Control Panel. " Goto Unlock If

This document contains a batch script that locks and unlocks a folder on a system. It first checks if the folder is already locked, and if not creates a lock file. It then prompts the user to confirm locking the folder, and if confirmed renames the lock file to the folder name and sets attributes to hide and system file. To unlock, it prompts for a password and if correct removes the attributes and renames the file back to the lock file name.

Uploaded by

imran200389
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

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%==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

You might also like