Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: Generate Password GeneratePassword System.Web System.Web.Security.Membership Random Password Specified Length
;*************************************************************************** ;** Generate Password ;** ;** Purpose: Generates a random password of the specified length. ;** Inputs: ;** length The number of characters in the generated password. The length must be between 1 and 128 characters. ;** numberOfNonAlphanumericCharacters The minimum number of non-alphanumeric characters (such as @, #, !, %, &, and so on) in the generated password. ;** ;** Outputs: A random password of the specified length. ;** ;** Reference: ;** REQUIRES WinBatch 2013A or newer ;** ;** Developer: Deana Falk 2013.05.10 ;*************************************************************************** If Version( )< '2013A' Pause( 'Notice', 'Need 2013A or Newer Version of WinBatch' ) Exit EndIf ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; Load assemblies into the WinBatch process. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ObjectClrOption( 'use', 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; Prompt for input ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Length = 8 NumNonAlpha = 3 ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; Create a class implemented by a managed assembly. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ oMembership = ObjectClrNew( 'System.Web.Security.Membership' ) result = oMembership.GeneratePassword( Length, NumNonAlpha ) Message( 'GeneratePassword' , result ) Exit
Article ID: W17844
Filename: Generate Password.txt
File Created: 2013:06:17:11:22:18
Last Updated: 2013:06:17:11:22:18