当前位置:DOS资源站资料中心VBS脚本 → VBS开启与关闭自动登陆

VBS开启与关闭自动登陆

减小字体 增大字体 作者:佚名  来源:本站整理  发布时间:2008-5-23 20:29:51

Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set objReg=GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = "Software\Microsoft\Windows NT\CurrentVersion\WinLogon"
strValueName = "AutoAdminLogon"
dwValue = 0 '当值为0时关闭自动登陆,1时为开启
objReg.SetDWORDValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, dwValue
If dwValue = 1 Then
Wscript.Echo "自动登陆开启成功"
Else
Wscript.Echo "自动登陆关闭成功"
End If