Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to automatically log on as administrator

Status
Not open for further replies.

Nazgulero

IS-IT--Management
Oct 24, 2003
45
NL
Hello,

I have a problem with my laptop running XP Pro: for some reason, I am automatically logged on as a guest, and from within the guest account, I am unable to access the user accounts. Is there any way to log in as administrator automatically instead of as a guest ? I have searched the registry, but I am not sure if the guest account is allowed to make any changes...
Thanks a lot in advance.

Regards,

Naz
 
I think you have the guest account without a password, if you set up a password to this account you will be able to log on as another user.

Greetings

 
Just click shutdown and log off the account. Change the account name to administrator and enter the password.

There is a point in wisdom and knowledge that when you reach it, you exceed what is considered possible - Jason Schoon
 
The following script will configure Autologin

Code:
'==========================================================================
'
' NAME: AutoLoginConfig.vbs
'
' AUTHOR: Mark D. MacLachlan , The Spider's Parlor
' URL: [URL unfurl="true"]http://www.TheSpidersParlor.com[/URL]
' COPYWRITE (c) 2005 All Rights Reserved
' DATE  : 2/18/2006
'
' COMMENT: Configures AutoLogin and allows screen lock.  
' USAGE:   Login as the ID to be set for auto login and execute this script.
'
'==========================================================================

on error resume next
Dim WshNetwork, strDomainName, path
Set WshNetwork = WScript.CreateObject("WScript.Network")
Set WSHShell = Wscript.CreateObject("WScript.Shell")
path = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\"
strDomainName = WshNetwork.UserDomain
strUserName = WshNetwork.UserName
AdminPassword = InputBox("Enter Admin Password","Password?")
WSHShell.RegWrite path & "AutoAdminLogon","1","REG_DWORD"
WSHShell.RegWrite path & "DefaultUserName",strUsername,"REG_SZ"
WSHShell.RegWrite path & "DefaultDomainName",strDomain,"REG_SZ"
WSHShell.RegWrite path & "DefaultPassword",AdminPassword,"REG_SZ"

If Msgbox("Do you wish to lock the screen after startup?", vbYesNo, "Security Risk!") = vbYes Then
	Set fso = CreateObject("Scripting.FileSystemObject")
	strStartup = WSHShell.SpecialFolders("Startup")
	Set ts = fso.CreateTextFile(strStartup & "\lock.txt", ForWriting)
		ScriptCode = "Set WSHShell = Wscript.CreateObject("& Chr(34) & "WScript.Shell" & Chr(34) & ")" & vbCrLf
		ScriptCode = ScriptCode & "WSHShell.Run("& Chr(34) & "rundll32.exe user32.dll, LockWorkstation" & Chr(34) & ")"
	ts.write ScriptCode
	ts.close
	WScript.Sleep 1000
	fso.MoveFile (strStartup & "\lock.txt"),(strStartup & "\lock.vbs")
End If



If err then
	msgbox "Error Encountered"
Else
	msgbox "Auto Login Configured Successfully"
End if

I hope you find this post helpful.

Regards,

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top