Batch Script to create local user in Windows:


Following batch script ask for your input to create user and set password never expire.

Incase you want password to expire as per system security policy just comment (put :: )
:: WMIC USERACCOUNT WHERE "Name='%user%'" SET PasswordExpires=FALSE.

Tips: see net user help for more

:: Script Starts here

@echo off
:: Created by wtuto.com
title ### Script to create Local User Account ###
echo.
echo ----------------------------------
echo ...Creating Local User Account...
echo ----------------------------------
echo.
set /p user=Type User Name :
set /p pass=Type Password :
set /p name=Type Full Name :
cls
net localgroup
echo.
echo -------------------------------------------------------------------------
echo ...Group Membership from any of the above, OR Just Press Enter to Skip...
echo -------------------------------------------------------------------------
echo.
set /p group=Group Membership :
echo.
net user %user% "%pass%" /ADD /FULLNAME:"%name%" /COMMENT:"user" /ACTIVE:YES /PASSWORDCHG:NO
WMIC USERACCOUNT WHERE "Name='%user%'" SET PasswordExpires=FALSE
net localgroup "%group%" %user% /add
cls
pause

:: Script Ends Here 





Connect With Us
Instant Query
Your Name :
Email Address :
Message :