Jump to content
Sign in to follow this  

My Random Password Generator

Recommended Posts

hi, This is my first project in AutoIT I only started using it today. It a very basic program that asks the user to enter a length for the password then, one is generated and is copiyed to the clipboard.

Well Hope you may find it usfull it's my first attement as I not used to this cool AutoIT yet, but lucky I done some VB and know a little bit, I hope to update this project to support a GUI as time goes on. Comments are welcome.

#include <StringConstants.au3>

   const $pwsMask = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
   Const $Msg1 = "Your password was copiyed to the clipboard."
   const $msgPrompt = "Please enter the size of the password you want to create below:"

   Local $len
   Local $n
   Local $buff

   $Len =  InputBox("Ben Password Generator v1.0",$msgPrompt,"8")
   $len =  StringStripWS($len,$STR_STRIPALL)

   ;Check that user has entered a vaild password length
   if not StringIsDigit($len) or $len = 0 Then
      MsgBox(48,"Error","Invaild Integer was entered" & @CRLF & "Program will now exit.")

   ;This creates the random password.
   for $i = 1 to $Len
      ;Pick a random chat between 1 and the pwsMask Length
      $n = int(random(1,StringLen($pwsMask)))
      ;Concat each chat that has been picked out of pwsMask to $buff
      $buff = $Buff & StringMid($pwsmask,$n,1)

   ;Put new password on the clipboard.
   ClipPut("Password: " & $buff)
   ;Inform user password was created


On Error Resume Pulling Hair Out.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...