This question has an overlap with programming, but I think it primarily belongs here. I'm building an elaborate script in AutoIt that switches on autologon so that multiple unattended reboots are possible. I also check if autologon was already switched on, and if so, I do nothing.
If not, however, I ask for a password, check if the password is valid by a call to the LogonUser API of advapi.dll, then I set the following registry settings as per http://support.microsoft.com/kb/324737/
RegWrite('HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon', 'AutoAdminLogon', 'REG_DWORD', 1) RegWrite('HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon', 'DefaultUserName', 'REG_SZ', $username) RegWrite('HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon', 'DefaultPassword', 'REG_SZ', $password)
Normally, this works just fine. However, somebody working in the field just reported that my script asks for a password on a computer running Windows 7 Professional which already had autologon enabled.
When I check the registry, under HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon, I don't find any of the required keys, i.e. AutoAdminLogon, DefaultUserName and DefaultPassword.
When I run netplwiz, that also states that 'users must enter a username and a password' to login; the checkbox is checked.
So what's going on here? Is this even possible? Is there another autologon mechanism out there? How does it work and how do I detect it? Unfortunately this is just one machine in the field, and I don't have access to it now. I only got one look; through TeamViewer. Any help appreciated.