Here's my code:
UpdateAutoLogon(1,"Mylogin","MyPassword","MyDomain")
Func UpdateAutoLogon($iEnabled,$sAutoLogonUserName,$sAutoLogonPassword,$sAutoLogonDomain)
local $ErrorNum = 0
local $sHive
$sHive = "HKLM"
if @OSArch = "X64" or @OSArch = "IA64" then $sHive = "HKLM64"
;
RegWrite($sHive & "\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon","AutoAdminLogon","REG_SZ",$iEnabled)
if @error<>0 then $ErrorNum = @error
RegWrite($sHive & "\SOFTWARE\Microsoft\Windows NT\CurrentVers