XP Autologin
- NoahPhense
- Addict
- Posts: 1999
- Joined: Thu Oct 16, 2003 8:30 pm
- Location: North Florida
XP Autologin
Does anyone have some code that will setup an auto login for xp?
- np
- np
- NoahPhense
- Addict
- Posts: 1999
- Joined: Thu Oct 16, 2003 8:30 pm
- Location: North Florida
These are both excellent references. Here's what I'm looking to do. IDroopy wrote:http://support.microsoft.com/kb/315231/en-us
have a system at work that I'm testing this on. But more importantly.
If this works well, it will be pushed out and auto-executed globally to
2 to 3 systems per location.
Do you think I can use these references to make a single executable that
when launched from the administrators profile, or with the administrators
credentials. It can set these systems into auto login mode?
- np
- NoahPhense
- Addict
- Posts: 1999
- Joined: Thu Oct 16, 2003 8:30 pm
- Location: North Florida
That wasn't really a contribution..thefool wrote:i really can't see why you wouldnt be able to do that..
look at the references!

I am a bit scidish about the reference on MS that shows how to do this.
But it only talks about the account that you want to autolog, being an
administrator account.
Well, I don't want an administrator account to autolog, I want a regular
user account to autolog.
*EDIT* .. I got something working.. I'll post later.
- np
LogonUser is not administror specific, it is up to you to choose who do you want to log as specified in the param, then, you should use ImpersonateLoggedOnUser with the value returned by LogonUser.
-
- Addict
- Posts: 1073
- Joined: Fri Apr 25, 2003 11:13 pm
- Location: Netherlands
- Contact:
- NoahPhense
- Addict
- Posts: 1999
- Joined: Thu Oct 16, 2003 8:30 pm
- Location: North Florida
I've done this. But have experienced a major security issue. After I'veDroopy wrote:It's easy with admin rights and purebasic to write to registry. ( write values to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\Winlogon : DefaultUserName / DefaultPassword / AutoAdminLogon ...
edited the registry settings. You cannot log into the system via RA
anymore. I know, wierd.
And to add to that pain, the auto log didn't work.
Keep in mind that the computer is on a domain. But the account that
I'm having auto log is a local account to the machine.
- np
You can autologon to a domain with the 'DefaultDomainName' value.
See here : http://www.winguides.com/registry/display.php/13/
See here : http://www.winguides.com/registry/display.php/13/
- NoahPhense
- Addict
- Posts: 1999
- Joined: Thu Oct 16, 2003 8:30 pm
- Location: North Florida
..
Hey Droopy..
Yeah I have that. But it still didn't work. There must be something else
junked up on these systems. I even thoguht it might be the legal notice,
but as you can see I cleared those out. Hmm..
- np
Yeah I have that. But it still didn't work. There must be something else
junked up on these systems. I even thoguht it might be the legal notice,
but as you can see I cleared those out. Hmm..
Code: Select all
; KAR Repair Utility
; by (removed)
Declare.s ReadRegKey(OpenKey.l, SubKey.s, ValueName.s)
Declare.l WriteRegKey(OpenKey.l, SubKey.s, KeySet.s, KeyValue.s)
Define.l key1, key2, key3, key4, key5, key6, key7, key8
start.s = InputRequester("KIOSK AUTO-LOGON REPAIR", "Type " + Chr(34) + "yes" + Chr(34) + " to proceed.", "")
If LCase(start) = "yes"
If InitNetwork()
DefaultDomain.s = Hostname()
key1 = WriteRegKey(#HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultUserName", "kiosk")
key2 = WriteRegKey(#HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultPassword", "")
key3 = WriteRegKey(#HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultDomain", DefaultDomain)
key4 = WriteRegKey(#HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "CachePrimaryDomain", DefaultDomain)
key5 = WriteRegKey(#HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "AutoAdminLogon", "1")
key6 = WriteRegKey(#HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "ForceAutoLogon", "1")
key7 = WriteRegKey(#HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "LegalNoticeCaption", "")
key8 = WriteRegKey(#HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "LegalNoticeText", "")
Else
MessageRequester("HostName Issue ..", "HostName Not Found -- please enter it in the next window.")
DefaultDomain.s = InputRequester("Enter HostName", "i.e. MIAMBKI967391 (don't forget the KI)","")
key1 = WriteRegKey(#HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultUserName", "kiosk")
key2 = WriteRegKey(#HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultPassword", "")
key3 = WriteRegKey(#HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultDomain", DefaultDomain)
key4 = WriteRegKey(#HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "CachePrimaryDomain", DefaultDomain)
key5 = WriteRegKey(#HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "AutoAdminLogon", "1")
key6 = WriteRegKey(#HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "ForceAutoLogon", "1")
key7 = WriteRegKey(#HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "LegalNoticeCaption", "")
key8 = WriteRegKey(#HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "LegalNoticeText", "")
EndIf
If key1 And key2 And key3 And key4 And key5 And key6 And key7 And key8
MessageRequester("Success!", "All registry keys were correctly modified.", #MB_ICONINFORMATION)
EndIf
Else
; do nothing
EndIf
MessageRequester("K.A.R. - Kiosk Auto-Logon Repair", "© (removed) International // coded by (removed)")
End
;- Procedures
; read a key from the registry
Procedure.s ReadRegKey(OpenKey.l, SubKey.s, ValueName.s)
hKey.l = 0
KeyValue.s = Space(255)
Datasize.l = 255
If RegOpenKeyEx_(OpenKey, SubKey, 0, #KEY_READ, @hKey)
KeyValue = "Error Opening Key"
Else
If RegQueryValueEx_(hKey, ValueName, 0, 0, @KeyValue, @Datasize)
KeyValue = "Error Reading Key"
Else
KeyValue = Left(KeyValue, Datasize - 1)
EndIf
RegCloseKey_(hKey)
EndIf
ProcedureReturn KeyValue
EndProcedure
;write a key to the registry
Procedure.l WriteRegKey(OpenKey.l, SubKey.s, KeySet.s, KeyValue.s)
hKey.l = 0
If RegCreateKey_(OpenKey, SubKey, @hKey) = 0
Result = 1
Datasize.l = Len(KeyValue)
If RegSetValueEx_(hKey, KeySet, 0, #REG_SZ, @KeyValue, Datasize) = 0
Result = 2
EndIf
RegCloseKey_(hKey)
EndIf
ProcedureReturn Result
EndProcedure
-
- New User
- Posts: 8
- Joined: Tue Aug 15, 2006 4:38 pm
I haven't used PureBasic yet... Window shopping
But make sure you are setting all these values:
AutoAdminLogon
ForceAutoLogon
DefaultUserName
AltDefaultUserName
DefaultPassword
DefaultDomainName
AltDefaultDomainName
And LegalNotice/Logon Banner text won't stop it from working. To bypass the autlogon and get the prompt (for when you logon), hold down the shift key.
I do this sort of thing remotely in batch files using reg.exe i.e.
reg add "\\%strRemoteHostname%\HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v ForceAutoLogon /t REG_SZ /d 1 /f

But make sure you are setting all these values:
AutoAdminLogon
ForceAutoLogon
DefaultUserName
AltDefaultUserName
DefaultPassword
DefaultDomainName
AltDefaultDomainName
And LegalNotice/Logon Banner text won't stop it from working. To bypass the autlogon and get the prompt (for when you logon), hold down the shift key.
I do this sort of thing remotely in batch files using reg.exe i.e.
reg add "\\%strRemoteHostname%\HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v ForceAutoLogon /t REG_SZ /d 1 /f
Edwin suggested a Sysinternals tools but didn't say which one. Here is a link to the program which may solve your problem:
http://www.sysinternals.com/Utilities/PsExec.html
It is very powerful and will allow you to run an app on a remote system with whatever credentials are needed.
http://www.sysinternals.com/Utilities/PsExec.html
It is very powerful and will allow you to run an app on a remote system with whatever credentials are needed.
Where ever you go, there you are.
-
- New User
- Posts: 8
- Joined: Tue Aug 15, 2006 4:38 pm