How To Keep Vista, 7 & XP's Password From Expiring

(Grammar Corrections By Evan J.)

By default, in Vista and sometimes in XP, you must reset your password every so often. Well, a lot of times this isn't needed and some people just get annoyed by it. Luckily, turning this off is VERY simple. However, you could also use the VBS script I wrote to automatically disable this feature.

This is a perfect tool for an admin, computer tech, or any common user. Sometimes just clicking a file and being done is better than doing it manually.

The VBS code is very simple and already available for you in the zip file.

This script references the currently logged on user to detect the names of both the current user and computer and then does the work for you.

Code-----------------------------------------------------------------------

Const ADS_UF_DONT_EXPIRE_PASSWD = &H10000

Dim user
Dim username
Dim computername
Dim lngFlag

Set WshNetwork = WScript.CreateObject("WScript.Network")

computername = WshNetwork.ComputerName
username = WshNetwork.UserName

Set user = GetObject("WinNT://" & computername & "/" & username & ",user")

lngFlag = user.Get("userflags")

If (lngFlag And ADS_UF_DONT_EXPIRE_PASSWD) = 0 Then

lngFlag = lngFlag Xor ADS_UF_DONT_EXPIRE_PASSWD
user.Put "userflags", lngFlag
user.SetInfo

msgbox username & " on " & computername & " Password now set to not expire."

else

msgbox username & " on " & computername & " Password already set to not expire."

End If
 

Code-----------------------------------------------------------------------

 

Now if you wish to do it manually that is very simple to.

Start with right clicking on "My Computer" or "Computer" and on that menu left click on “Manage”. From here, on the left, you go to "Local Users and Groups" then “Users”. Open your user(s) and finish by setting the field and click apply. All done!

Easy as pie, once you learn it.

Any questions or comments drop a line in the forum.
-Shane