办公室一台公用电脑,我装了XP和DOS双系统,并做了一个全自动GHOST的批处理文件。太方便了因此系统经常被人进入DOS随意GHOST还原。我想在GHOST还原前要求输入密码<能糊一些人>。批处理代码如下:
@echo off
set a=
set/p a=password:
if /i "%a%"=="123" goto aa
exit
::以下部分代替GHOST带参数命令
:aa
echo 你好
pause
@echo off
set choice=
set /p choice= password:
IF NOT "%Choice%"=="" SET Choice=%Choice:~0,1%
if /i "%choice%"=="h" goto aa
exit
::以下部分代替GHOST带参数命令
:aa
echo 你好
pause
能不能帮忙写一个?我对密码强度不要求,只要有密码就行。作者: lianjiang2004 时间: 2007-6-9 17:50 用choice就是纯dos下的。
刚刚查了个帖子,也是用choice的,不过能实现验证多位密码。供参考。
-----------------------------------------
将以下存成一个批处理文件.再跟据需要修改即可.
@echo off
:: 设置初使密码只能使用小写字母和数字
set pass=chenallqq368178720
:: 输入密码并验证
:pass
cls
echo.
echo.
echo. Please input your password!
echo.
echo. Password:%xxx%
choice /c:abcdefghijklmnopqrstuvwxyz1234567890 /N
if errorlevel 1 set chk=a
if errorlevel 2 set chk=b
if errorlevel 3 set chk=c
if errorlevel 4 set chk=d
if errorlevel 5 set chk=e
if errorlevel 6 set chk=f
if errorlevel 7 set chk=g
if errorlevel 8 set chk=h
if errorlevel 9 set chk=i
if errorlevel 10 set chk=j
if errorlevel 11 set chk=k
if errorlevel 12 set chk=l
if errorlevel 13 set chk=m
if errorlevel 14 set chk=n
if errorlevel 15 set chk=o
if errorlevel 16 set chk=p
if errorlevel 17 set chk=q
if errorlevel 18 set chk=r
if errorlevel 19 set chk=s
if errorlevel 20 set chk=t
if errorlevel 21 set chk=u
if errorlevel 22 set chk=v
if errorlevel 23 set chk=w
if errorlevel 24 set chk=x
if errorlevel 25 set chk=y
if errorlevel 26 set chk=z
if errorlevel 27 set chk=1
if errorlevel 28 set chk=2
if errorlevel 29 set chk=3
if errorlevel 30 set chk=4
if errorlevel 31 set chk=5
if errorlevel 32 set chk=6
if errorlevel 33 set chk=7
if errorlevel 34 set chk=8
if errorlevel 35 set chk=9
if errorlevel 36 set chk=0
set input=%input%%chk%
set xxx=%xxx%*
:: 密码检验,如果正确则退出
if #%pass%==#%input% goto end
goto pass
:end
运行后如果依次输入了chenallqq368178720就会退出,否则.........
这是密码检验的批处理,可以修改一下变成设置密码的批处理.作者: hdyue 时间: 2007-6-9 18:06 lianjiang2004,你好!谢谢你。
http://www.cn-dos.net/forum/viewthread.php?tid=18848&fpage=2作者: terse 时间: 2007-8-15 21:26 用WBAT的
reboot 外部命令 重启机器的
@echo off
cls
WBAT CLS (+cyan on black)
:start
set pass=
call w.bat menu
if errorlevel 100 goto end
if %?%#==2# goto end
if %pass%#==123# goto ghost
goto start
:ghost
GHOST带参数命令
goto end
:end
reboot
::
:menu "【DOS启动盘】"[x]
===================================