dkreifus Posted March 6, 2006 Share 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? Link to comment Share on other sites More sharing options...
Doc Symbiosis Posted March 7, 2006 Share Posted March 7, 2006 Looks like the admin2 account doesn't eixst or the password is wrong.What error message do you receive. Link to comment Share on other sites More sharing options...
dkreifus Posted March 7, 2006 Author Share 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? Link to comment Share on other sites More sharing options...
exrcizn Posted March 7, 2006 Share Posted March 7, 2006 Is admin2 an administrator? Link to comment Share on other sites More sharing options...
dkreifus Posted March 8, 2006 Author Share 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now