I have created a Batch file as below
@echo off setlocal EnableDelayedExpansion echo Type Below Requirements: echo. :username set /p usr= Type Username: if [!usr!]== goto username :password set /p pwd= Type Password: if [!pwd!]== goto password echo. echo Your username is: !usr! echo Your password is: !pwd!
pause net user /add %usr% %pwd% /COMMENT:"Password: %pwd%" /EXPIRES:NEVER /PASSWORDCHG:NO /ADD WMIC USERACCOUNT WHERE "Name='%usr%'" SET PasswordExpires=FALSE pause exit
I have Separate as SECTION 01 and 02 just for explanation. i.In SECTION 01 If type any symbol or space between username, should show "INVALID USERNAME PLEASE TRY AGAIN" before proceeding to password. ii. If Password Typed, should check for Password Policy before proceeding to SECTION 02.
Is it Possible, Please advice