Windows自带有密码保护系统,但是有破解的可能,因此,可以设计一个cmd程序来保护电脑,代码如下:
@echo off
taskkill /f /t /im explorer.exe
mshta vbscript:msgbox("please enter your password before using Windows",64,"WinLS")(window.close)
:password
set /p var=Please enter a password to unlock Windows:
if %var%==你的密码 (goto unlock) else (goto error)
:unlock
mshta vbscript:msgbox("The password is correct, Windows will unlock in 10 seconds",64,"WinLS")(window.close)
timeout /t 10
start explorer.exe
mshta vbscript:msgbox("Windows and being unlocked")(window.close)
exit
:error
mshta vbscript:msgbox("Password error, please re-enter the password. After three errors, the computer will restart",16,"WinLS-error")(window.close)
goto retry1
:retry1
set /p var=Please enter a password to unlock Windows:
if %var%==你的密码 (goto unlock) else (goto error2)
:error2
mshta vbscript:msgbox("Password error, please re-enter the password. If the error occurs twice, the computer will restart",16,"WinLS-error")(window.close)
goto retry2
:retry2
set /p var=Please enter a password to unlock Windows:
if %var%==你的密码 (goto unlock) else (goto error3)
:error3
mshta vbscript:msgbox("Password error, please re-enter the password. If the error occurs once, the computer will restart",16,"WinLS-error")(window.close)
goto retry3
:retry3
set /p var=Please enter a password to unlock Windows:
if %var%==你的密码 (goto unlock) else (goto error4)
:error4
mshta vbscript:msgbox("Password error, your computer will be restarted",16,"WinLS-error")(window.close)
shutdown -r now