dkreifus Posted March 6, 2006 Posted March 6, 2006 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 2500End SubANDThis worksSub 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 SubAm I missing something here?
Doc Symbiosis Posted March 7, 2006 Posted March 7, 2006 Looks like the admin2 account doesn't eixst or the password is wrong.What error message do you receive.
dkreifus Posted March 7, 2006 Author Posted March 7, 2006 After some research, I discovered this message as the culprit:"Some keys are open by the system or other processes."I am running this as administrator. Any ideas?
dkreifus Posted March 8, 2006 Author Posted March 8, 2006 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 takeLooks 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now