Sign in to follow this  
Followers 0
mminisee

Ideas On Script To Edit Registry For A Windows Fix

5 posts in this topic

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. :whistle:

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

Share this post


Link to post
Share on other sites



Your script would need this line: (all on 1 line)

RegWrite("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\policies\system","DontDisplayLastUserName", "REG_DWORD",1)

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

ahhh.. you are using Ver2 .... :whistle:

You need to replace the regwrite line with:

RegWrite,REG_DWORD, HKEY_LOCAL_MACHINE, Software\\Microsoft\\Windows\\CurrentVersion\\policies\\system,DontDisplayLastUserName,1

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Thank you! So any takers on sharing some common Admin task scripts? :whistle:

Share this post


Link to post
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
Sign in to follow this  
Followers 0