CODE: [Copy to clipboard]
on error resume next
dim welcomeinfo
welcomeinfo=msgbox("本工具将帮助你设置Windows自动登陆用户,是否继续?",1,"提示信息")
if welcomeinfo<>1 then wscript.quit
dim wshshell
dim rootkey
dim userkey
dim passwordkey
dim logonkey
dim username
dim password
dim tsinfo
do
username=inputbox("请输入你的用户账号:","提示信息")
if username="" then
tsinfo=msgbox("用户账号不能为空,要重新输入吗?",1,"提示信息")
if tsinfo<>1 then wscript.quit
end if
loop until username<>""
password=inputbox("请输入你的用户密码:","提示信息")
set wshshell=createobject("wscript.shell")
rootkey="HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\"
userkey=rootkey & "\DefaultUserName"
passwordkey=rootkey & "\DefaultPassWord"
logonkey=rootkey & "\AutoAdminLogon"
wshshell.regwrite userkey,username
wshshell.regwrite passwordkey,password
wshshell.regwrite logonkey,"1"
if err then
msgbox "设置失败,请重试!",,"提示信息"
err.clear
else
msgbox "设置成功!",,"提示信息"
end if
set wshshell=nothing
[