Jump to content

Ideas On Script To Edit Registry For A Windows Fix


mminisee
 Share

Recommended Posts

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

Link to comment
Share on other sites

  • Developers

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

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

  • Developers

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

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

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
 Share

  • Recently Browsing   0 members

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