Sample code for 30+ languages & platforms
AutoIt

Generating Random Password

See more PRNG Examples

Demonstrates how to generate random passwords.

Chilkat AutoIt Downloads

AutoIt
Local $bSuccess = False

;  This example assumes the Chilkat API to have been previously unlocked.
;  See Global Unlock Sample for sample code.

$bSuccess = False

$oFortuna = ObjCreate("Chilkat.Prng")

;  Set this equal to True if the generated password must include at least one digit (0-9)
Local $bDigit = True

;  Set this equal to True if the generated password must include both uppercase and lowercase chars.
Local $bUpperAndLower = True

;  The generated password must contain one of the following non-alphanumeric chars.
Local $sOtherChars = "@#$%*"

;  Exclude chars that appear similar to others:
Local $sExcludeChars = "iIlLoO0"

;  Generate 8-character passwords:
Local $i
For $i = 1 To 10
    ConsoleWrite($oFortuna.RandomPassword(8,$bDigit,$bUpperAndLower,$sOtherChars,$sExcludeChars) & @CRLF)
Next