Vbscript / General / Generate Random Password
This script generates a random alpha-numeric password of variable length.
Use intUpperLimit = 126, intLowerLimit = 33 and remove the `If` conditional to include special characters.
intMaxLenth = 14 intMinLength = 7
Randomize
intCharacters = Int(((intMaxLenth - intMinLength + 1) * Rnd) + intMaxLenth)
intUpperLimit = 122 intLowerLimit = 48
For i = 1 to intCharacters
Randomize
intChar = Int(((intUpperLimit - intLowerLimit + 1) * Rnd) + intLowerLimit)
If (intChar < 58 OR intChar > 64) AND (intChar < 91 OR intChar > 96) Then strPassword = strPassword & Chr(intChar) End If Next
Wscript.Echo strPassword
Please note that a disclaimer applies to any code on this page.
|