Lock your CMD, can only enter the password to use. The code is as follows
1: Save the following as lock.reg, note that there should be a blank line after Windows Registry Editor Version 5.00
2. Save the following as unlock.reg. This is for unlocking the CMD. Also, there should be a blank line after Windows Registry Editor Version 5.00
3. Save the following code as lock.bat
4. Save the following code as setup.bat
5. Save the following code as uninstall.bat
Instructions: This is adapted from the code written by an expert
uninstall.bat is for unlocking. The password here is lgx
If you want to define your own password, you can use the replacement method to replace all lgx in lock.bat with your password
There are a total of 5 files. Actually, it can all be done through one batch file.
setup.bat is used to install the CMD password lock. The principle should be understandable. It is to lock the CMD through the registry
Just run setup.bat to lock your CMD. Remember that the password is lgx and can be replaced freely.
Please pay attention to my QQ space
http://410454068.qzone.qq.com/
[ Last edited by lgx8280998 on 2006-11-16 at 12:23 PM ]
1: Save the following as lock.reg, note that there should be a blank line after Windows Registry Editor Version 5.00
Windows Registry Editor Version 5.00
"AutoRun"="lock.bat2. Save the following as unlock.reg. This is for unlocking the CMD. Also, there should be a blank line after Windows Registry Editor Version 5.00
Windows Registry Editor Version 5.00
"AutoRun"=-3. Save the following code as lock.bat
@echo off
title Password Verification
SETLOCAL
set pwd=0
set times=3
echo ________________________________________________________________________________
echo You are now using 's CMD. You cannot execute any commands without 's permission.
echo All your operations and messages used this time have been recorded in the log. If you don't have a password yet, please contact . If you already have a password, please enter it!
echo ________________________________________________________________________________
echo ####################################################################### >> e:\mylog.txt
echo Operation: Activate password verification Time: %time% Date: %date% >> e:\mylog.txt
echo Status: Waiting for verification... >> e:\mylog.txt
echo . >> e:\mylog.txt
echo
:password
set /p pwd= Please enter your password:
set /A times=%times%-1
if %pwd%==lgx goto pass
echo ***** Password verification error, please re-enter You have %times% more chances to enter the password *****
echo .
if %times%==0 goto close
echo Status: User entered password Verification failed Time: %time% >> e:\mylog.txt
goto password
:close
echo Status: User entered password incorrectly 3 times Program locked Time: %time% >> e:\mylog.txt
title Sorry, you cannot use 's CMD
echo --------------------------------------------------------------------------------
echo Since you failed the password verification 3 times, the program has been locked. You can no longer operate. You can choose to close this window or leave a message to contact . Please enter the message and press Enter to submit!
echo --------------------------------------------------------------------------------
echo
:message
echo ________________________________________________________________________________
set /p msg= Please enter your message:
echo . >> e:\mymsg.txt
echo ####################################################################### >> e:\mymsg.txt
echo Date: %date% Time: %time% >> e:\mymsg.txt
echo Message content: >> e:\mymsg.txt
echo %msg% >> e:\mymsg.txt
echo . >> c:\message.txt
echo …… OK ……
echo Your message has been recorded. You can choose to close the window or continue to leave a message
echo Operation: User left a message Time: %time% >> e:\mylog.txt
goto message
:pass
echo Status: Program is open, welcome to use Time: %time% >> e:\mylog.txt
title 's CMD
ENDLOCAL4. Save the following code as setup.bat
@echo off
copy /y lock.bat %windir%\lock.bat
echo lock.bat installed successfully
regedit /s lock.reg
echo lock.reg registered successfully5. Save the following code as uninstall.bat
@echo off
del /f lock.bat %windir%\lock.bat
echo lock.bat deleted successfully
regedit /s unlock.reg
echo lock.reg unregistered successfullyInstructions: This is adapted from the code written by an expert
uninstall.bat is for unlocking. The password here is lgx
If you want to define your own password, you can use the replacement method to replace all lgx in lock.bat with your password
There are a total of 5 files. Actually, it can all be done through one batch file.
setup.bat is used to install the CMD password lock. The principle should be understandable. It is to lock the CMD through the registry
Just run setup.bat to lock your CMD. Remember that the password is lgx and can be replaced freely.
Please pay attention to my QQ space
http://410454068.qzone.qq.com/
[ Last edited by lgx8280998 on 2006-11-16 at 12:23 PM ]
