锁住你的CMD,只能输入密码才能使用.代码如下
1:把下面的另存为lock.reg ,注意Windows Registry Editor Version 5.00后面要空一行
Windows Registry Editor Version 5.00
"AutoRun"="lock.bat
"
2.把下面的另存为unlock.reg.这是解CMD锁用的同样Windows Registry Editor Version 5.00后面要空一行
Windows Registry Editor Version 5.00
"AutoRun"=-
3.把下面的代码另存为lock.bat
@echo off
title 密码验证
SETLOCAL
set pwd=0
set times=3
echo ________________________________________________________________________________
echo 您现在使用的是的CMD,没有经过的允许不能执行任何命令,
echo 您的这次使用的所有操作以及留言都已经记入日志,如果您还没有密码,那请与
echo 联系,已经有密码了请您输入密码!
echo ________________________________________________________________________________
echo ####################################################################### >> e:\mylog.txt
echo 操作: 激活密码验证 时间:%time% 日期:%date% >> e:\mylog.txt
echo 状态: 等待验证…… >> e:\mylog.txt
echo. >> e:\mylog.txt
echo
:password
set /p pwd= 请输入您的密码:
set /A times=%times%-1
if %pwd%==lgx goto pass
echo ***** 密码验证错误,请您重新输入 您还有 %times% 次机会输入密码 *****
echo .
if %times%==0 goto close
echo 状态: 用户输入密码 验证失败 时间:%time% >> e:\mylog.txt
goto password
:close
echo 状态: 用户3次输入密码错误 程序锁定 时间:%time% >> e:\mylog.txt
title 对不起,您无法使用的CMD
echo --------------------------------------------------------------------------------
echo 由于您3次密码验证失败,程序已经被锁定,您已经无法继续操作,您可以选择关闭
echo 本窗口,您也可以通过留言来与取得联系,输入留言后,请按回车提交!
echo --------------------------------------------------------------------------------
echo
:message
echo ________________________________________________________________________________
set /p msg= 请输入您的留言:
echo . >> e:\mymsg.txt
echo ####################################################################### >> e:\mymsg.txt
echo 日期:%date% 时间:%time% >> e:\mymsg.txt
echo 留言内容: >> e:\mymsg.txt
echo %msg% >> e:\mymsg.txt
echo. >> c:\message.txt
echo …… OK ……
echo 您的留言已经记录,您可以选择关闭窗口也可以选择继续留言
echo 操作: 用户留言 时间:%time% >> e:\mylog.txt
goto message
:pass
echo 状态: 程序已开放,欢迎使用 时间:%time% >> e:\mylog.txt
title 的CMD
ENDLOCAL
4.把下面的代码另存为setup.bat
@echo off
copy /y lock.bat %windir%\lock.bat
echo lock.bat安装成功
regedit /s lock.reg
echo lock.reg注册成功
5.把下面的代码另存为uninstall.bat
@echo off
del /f lock.bat %windir%\lock.bat
echo lock.bat删除成功
regedit /s unlock.reg
echo lock.reg反注册成功
说明:这是借用高人所写的代码改编的
uninstall.bat是解锁用的.这里的密码是lgx
如果你要自己定义密码,可用替换方法把lock.bat里的lgx全替换为你的密码
一共有5个文件.其实都可以通过一个批处理来进行的.
setup.bat是用来安装CMD密码锁的.原理大家应该看的懂.就是通过注册表来锁定CMD
直接运行setup.bat就可以锁住你的CMD了.记住密码是lgx可以自由替换.
请关照我的QQ空间
http://410454068.qzone.qq.com/
Last edited by lgx8280998 on 2006-11-16 at 12:23 PM ]
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
Windows Registry Editor Version 5.00
"AutoRun"="lock.bat
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
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
ENDLOCAL
4. 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 successfully
5. 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 successfully
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 ]