利用循环。
$reg = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
If RegRead($reg, "AutoAdminLogon") = 1 Then
$jx = MsgBox(32 + 4, "提示", "你已经设置了自动登陆,请问还要继续设置吗?")
If $jx = 7 Then Exit
EndIf
Do
$user = RegRead($reg, "DefaultUserName")
$PASS = RegRead($reg, "DefaultPassword")
$NAME = InputBox("自动登陆", "请输入用户名:", $user, "", 250, 100)
If $NAME == "" Then
MsgBox(16, "提示", "用户名不能为空!")
ContinueLoop
EndIf
Until 1
$PASSWORD = InputBox("自动登陆", "请输入密码:", $PASS, "*", 250, 100)
RegWrite($reg, "DefaultUserName", "REG_SZ", $NAME)
RegWrite($reg, "AutoAdminLogon", "REG_SZ", 1)
RegWrite($reg, "DefaultPassword", "REG_SZ", $PASSWORD)
MsgBox(64, "提示", "设置完成!")
|