I found the following VBscript function to generate a random code using Uppercase & Lowercase characters. I'd like to extend it to include digits - I tried by adding in the extra few lines (max3 and min3) , but am not sure how to change the Array to allow for the new variables.
Function GenerateRandomString(StrLen,upper,lower,numeric)
Dim charCase
' ASCII: Lowercase Alpha Characters
max=122
min=97
' ASCII: Capital Alpha Characters
max2=90
min2=65
// THIS BELOW IS WHAT I ADDED:
' ASCII: numeric Characters
max3=57
min3=49
// END ADD
For i=0 To (StrLen-1)
Randomize
charCase = Array((max-min+1)*Rnd+min,(max2-min2+1)*Rnd+min2) <!-- Not sure how to change this?
myStr = myStr & Chr(int(charCase(int(Rnd*2))))
Next
GenerateRandomString = myStr
End Function