Jump to content

Auto Logon doesn't work


Recommended Posts

I have a script that runs..it sets Auto Logon for a user, restarts, is supposed to log in as that user, copies the default profile, restarts then auto logs in as the admin, deletes that user, and all is done.

I've tried using vb script:

Sub AutoLogin1

' add registry key for autoadmin logon
oReg.SetStringValue HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "AutoAdminLogon", "1"

' add registry key for autoadmin logon
oReg.SetStringValue HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultUserName", "Admin2"

' add registry key for autoadmin password
oReg.SetStringValue HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultPassword", "testing"

' add registry key to execute script after reboot through run once
oReg.SetStringValue HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce", "Runsysprep", "C:\install\RnSysprp.vbs"

oIEDoc.WriteLn "<p><center><font color=""blue"">Registry keys for Autologon set</font></center></p>"
Wscript.Sleep 2500

End Sub

AND

This works

Sub AutoLogin2

' add registry key for autoadmin logon
oReg.SetStringValue HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "AutoAdminLogon", "1"

' add registry key for autoadmin logon
oReg.SetStringValue HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultUserName", "Administrator"

' add registry key for autoadmin password
oReg.SetStringValue HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultPassword", "mypassword"

' add registry key to execute script after reboot through run once
oReg.SetStringValue HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce", "Runsysprep", "C:\install\RnSysprp.vbs"

oIEDoc.WriteLn "<p><center><font color=""blue"">Registry keys for Autologon set</font></center></p>"
Wscript.Sleep 2500

End Sub

Am I missing something here?

Link to comment
Share on other sites


Well, I was wrong. That error message was not the culprit.

The problem is that the registry file doesn't take for some reason.

If I execute the .reg file and import everything..it doesnt take. But if I go and manually see that the files are there, then it takes?

Any ideas?

It doesnt matter if it is a VB script or .reg file. it doesnt take

Looks like the admin2 account doesn't eixst or the password is wrong.

What error message do you receive.

it does exist. I create it during cmdlines.txt. I get to the logon screen and it is there. The password is accurate. I don't get a prompt for wrong password. And if I log in, and run the script a second time or I check on it manually, it seems to work.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...