Create random passwords with Characters and integers, using VB script

Create random passwords with Characters and integers, using VB script

This VB script can be used for creation of passwords for new users during account creation.

Dim intMax, iLoop, k, intValue, strChar, strName, intNum

' Specify the alphabet of characters to use.
Const Chars = "abcdefghijklmnopqrstuvwxyz"

' Specify length of names.
intMax = 5

' Specify number of names to generate.
intNum = 1

Randomize()
For iLoop = 1 To intNum
    strName = ""
    For k = 1 To intMax
        ' Retrieve random digit between 0 and 25 (26 possible characters).
        intValue = Fix(26 * Rnd())
        ' Convert to character in allowed alphabet.
        strChar = Mid(Chars, intValue + 1, 1)
        ' Build the name.
        strName = strName & strChar
    Next

' Number of Integers can be specified here

    Wscript.Echo strName & Int( ( 7789 - 7 + 889 ) * Rnd + 999 )
Next
Leave a Comment
  • Please add 3 and 1 and type the answer here:
  • Post
Wiki - Revision Comment List(Revision Comment)
Sort by: Published Date | Most Recent | Most Useful
Comments
Page 1 of 1 (1 items)
Wikis - Comment List
Sort by: Published Date | Most Recent | Most Useful
Posting comments is temporarily disabled until 10:00am PST on Saturday, December 14th. Thank you for your patience.
Comments
Page 1 of 1 (4 items)