mminisee Posted February 23, 2004 Share Posted February 23, 2004 I am trying to write a script that would perform a registry tweak (see below) that clears the last username from the Windows NT/2000 logon box. I am rather new to the whole scripting thing but would really like to get a good understanding of it to help with these tasks that face Administrators everywhere. Registry Tweak; You can have the last username automatically cleared so that the next user has to enter in both the username and password to log in. In Windows 2000, there is a place in the Registry where this can also be controlled: Hive: HKEY_LOCAL_MACHINE Key: Software\Microsoft\Windows\CurrentVersion\Policies\System Name: DontDisplayLastUserName Data Type: REG_DWORD Value: 1 A value of 1 will clear the last username, a value of 0 leaves the last username in the login box. Any assistance is much appreciated, and if anyone has some common Admin scripts to share, I would be very greatful for that as well. Thanks, Mike Link to comment Share on other sites More sharing options...
Developers Jos Posted February 23, 2004 Developers Share Posted February 23, 2004 Your script would need this line: (all on 1 line) RegWrite("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\policies\system","DontDisplayLastUserName", "REG_DWORD",1) SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
mminisee Posted February 23, 2004 Author Share Posted February 23, 2004 Thanks for the super fast reply, I am encountering an error though ... After clicking Yes to install/perform this, I get the following ... "AutoIT Error (line4) Error: Invalid Command!" Here is the script; MsgBox, 4, *M@WS* Critical Update - Microsoft Windows 2000, This is a required System Security Update\nDo you wish to continue? IfMsgBox, NO, Goto, IWantToQuit RegWrite("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\policies\system","DontDisplayLastUserName", "REG_DWORD",1) IWantToQuit: Exit Link to comment Share on other sites More sharing options...
Developers Jos Posted February 23, 2004 Developers Share Posted February 23, 2004 ahhh.. you are using Ver2 .... You need to replace the regwrite line with: RegWrite,REG_DWORD, HKEY_LOCAL_MACHINE, Software\\Microsoft\\Windows\\CurrentVersion\\policies\\system,DontDisplayLastUserName,1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
mminisee Posted February 24, 2004 Author Share Posted February 24, 2004 Thank you! So any takers on sharing some common Admin task scripts? Link to comment Share on other sites More sharing options...
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