Adding & Deleting Users & Group

ghostomni's Avatar author of Adding & Deleting Users & Group
This is an article on Adding & Deleting Users & Group in Windows.
Rated 5.00 By 1 users
Adding & Deleting Users & Groups through a batch file. Copy Code On Notepad And save as Users & Group.bat

Code:
@cd\
@echo Off
@title User and Groups Scripts For XP And 2003
@color 2f

:Abo
@cls
@echo.
@echo.
@echo.        :: Nt The_Maker Adding, Deleting And Listing User Script ::
@echo.
@echo.        :: Email Me:- neeraj.tan@gmail.com
@echo.
:Menu
@echo.
@echo.
@echo.
@echo.    Press u To Add or delete User
@echo.    Press g To Add or delete Groups
@echo.    Press l To List Users and Groups
@echo.    Press h For Help Menu
@echo.    Press q To  Quit
@echo.
@echo.    "" use only small letter ""
@echo.
:Mainch
@echo.
@echo.
set us=
set /p us=   :: Enter your choice :
if "%us%" == "u" goto AU
if "%us%" == "g" goto AG
if "%us%" == "l" goto LU
if "%us%" == "h" goto HP
if "%us%" == "q" goto END
Goto :Mainch

:AU
@cls
:Menu2
@echo.
@echo.
@echo.              :: Nt Adding and Deleting User Menu ::
@echo.
@echo.              :: Email Me:- neeraj.tan@gmail.com ::
@echo.
@echo.
@echo.    Press 1 To Add User
@echo.    Press 2 To Delete User
@echo.    Press 3 To Main Menu
@echo.    Press q To Quit
@echo.
@echo.    "" use only small letter ""
@echo.
:Main2
@echo.
@echo.
set us=
set /p us=   :: Enter your choice :
if "%us%" == "1" goto AU2
if "%us%" == "2" goto DU
if "%us%" == "3" goto Men
if "%us%" == "q" goto end
Goto :Main2

:AU2
@echo. 
@echo.
@echo.        :: Nt Adding User Menu ::
@echo.
@echo.        :: Email Me:- neeraj.tan@gmail.com ::
@echo.
@echo. 
@echo. 

set /p User=  Enter User's Name         :

@echo.

set /p Passd=  Enter User's Password     :

@echo.
@net localgroup 
@echo.
@echo.====================== USER GROUP IS MUST ==========================
@echo.
@echo Enter Group Names Are Listed Above Type The Name Of Group In Group Info
@echo.
@echo Please Write Group Name With First Word Capital As Shown Without "*"
@echo.
@echo.
set /p Group=  Enter Group name For User :

@echo.
@echo.
@cls
@echo.
@echo.
@echo Entered User's Name  :: %User%
@echo.
@echo Entered Password     :: %Passd%
@echo.
@Echo Entered User Groups  :: %Group%
@echo.
@echo.
@echo Press y to Continue
@echo Press n to Reenter Inormation
@echo Press m to Main Menu
@echo Press q to Exit
@echo.
@echo.
:men2
@echo. :: "Is The Entered Information Is Correct" ::
@echo.
set us=
set /p us=   :: Enter Your Choice ::
if "%us%" == "y" goto Add
if "%us%" == "n" goto AU2
if "%us%" == "m" goto AU
if "%us%" == "q" goto end
goto :men2

:Add
@cls
@echo.
@echo.
@echo.
@echo.
@Net user %User% %Passd% /add && net localgroup %Group%

Pause
Goto :Men

@echo Off
:DU
@cls
@echo. 
@echo.
@echo.        :: Nt Delete User Menu ::
@echo.
@echo.        :: Email Me:- neeraj.tan@gmail.com ::
@echo.
@echo. 
@echo. 
@net user
@echo.
@echo.
@echo.
set /p user=  :: Enter UserName To Delete :

@cls
@echo.
@echo.
@echo.
@Echo. User Selected To Delete %User%
:men3
@echo.
@echo.
@echo Press y to Continue
@echo Press n to Reenter Inormation
@echo Press m to Main Menu
@echo Press q to Exit
@echo.
@echo.
@echo. :: "Is The Entered Information Is Correct" ::
@echo.
set us=
set /p us=   :: Enter Your Choice ::
if "%us%" == "y" goto Del
if "%us%" == "n" goto DU
if "%us%" == "m" goto AU
if "%us%" == "q" goto end
goto :men3
:Del
@cls
@echo.
@echo.
@echo.
@echo.
@Net user %User% /delete

Pause
Goto :Men

:AG
@cls
:Menu4
@echo.
@echo.
@echo.              :: Nt Adding and Deleting Group Menu ::
@echo.
@echo.              :: Email Me:- neeraj.tan@gmail.com ::
@echo.
@echo.
@echo.    Press 1 To Add Group
@echo.    Press 2 To Delete Group
@echo.    Press 3 To Main Menu
@echo.    Press q To Quit
@echo.
@echo.    
@echo.
:Main2
@echo.
@echo.
set us=
set /p us=   :: Enter your choice :
if "%us%" == "1" goto AG2
if "%us%" == "2" goto DG
if "%us%" == "3" goto Men
if "%us%" == "q" goto end
Goto :Main2

:AG2
@echo. 
@echo.
@echo.        :: Nt Adding Group Menu ::
@echo.
@echo.        :: Email Me:- neeraj.tan@gmail.com ::
@echo.
@echo. 
@echo. 

set /p Group=  Enter Group Name Name         :

@echo.
@echo.
@echo.
@cls
@echo.
@echo.
@echo Entered Group Name  :: %Group%
@echo.
@echo.
@echo Press y to Continue
@echo Press n to Reenter Inormation
@echo Press m to Main Menu
@echo Press q to Exit
@echo.
@echo.
:men2
@echo. :: "Is The Entered Information Is Correct" ::
@echo.
set us=
set /p us=   :: Enter Your Choice ::
if "%us%" == "y" goto AddG
if "%us%" == "n" goto AG2
if "%us%" == "m" goto AG
if "%us%" == "q" goto end
goto :men2

:AddG
@cls
@echo.
@echo.
@echo.
@echo.
@Net localgroup %Group% /add

Pause
Goto :Men

@echo Off
:DG
@cls
@echo. 
@echo.
@echo.        :: Nt Delete Group Menu ::
@echo.
@echo.        :: Email Me:- neeraj.tan@gmail.com ::
@echo.
@echo. 
@echo. 
@echo.
@echo.
@net localgroup
@echo.
@echo.      ==== Group Names Are Listed Above Enter Name To Delete Group ====
@echo.
@echo.
set /p Group=  :: Enter Group Name To Delete :

@cls
@echo.
@echo.
@echo.
@Echo. Group Selected To Delete %Group%

@echo.
@echo.
@echo Press y to Continue
@echo Press n to Reenter Inormation
@echo Press m to Main Menu
@echo Press q to Exit
@echo.
@echo.
@echo. :: "Is The Entered Information Is Correct" ::
@echo.
:men3
@echo.
@echo.
set us=
set /p us=   :: Enter Your Choice ::
if "%us%" == "y" goto DelG
if "%us%" == "n" goto DG
if "%us%" == "m" goto AG
if "%us%" == "q" goto end
goto :men3
:DelG
@cls
@echo.
@echo.
@echo.
@echo.
@Net localgroup %Group% /delete

Pause
Goto :Men

:LU
@cls
@echo.
@echo.
@echo.
@net localgroup && Net User
Pause
Goto :Men

:HP
@cls
@echo.
@echo.
@echo.              :: Email Me:- neeraj.tan@gmail.com ::
@echo.
@echo.
@echo.Nt The_Maker Script Create User And Groups Easily
@echo.
@echo.The Points To Remember Is Use Group Name Just As Shown
@echo.
@echo.Like If Group Name Is Administrator Type First Word Capital
@echo.
@echo.Right Administrator
@echo.Wrong administrator or any other way
@echo.
@echo.

:end
Exit

:men
Goto :Abo
Goto :Menu
Goto :Mainch
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Looks good but not for Vista and so I could not see it.
Izaan's Avatar, Join Date: Oct 2007
Skilled contributor
Thanks for sharing.
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
The Article is selected for Article of the month for October 2007. Now every one can vote for it to be the winner.
gprabhu's Avatar, Join Date: Aug 2007
Go4Expert Member
Hi!
Very useful program.
Thanks a lot!
arslan220's Avatar, Join Date: Mar 2007
Go4Expert Member
hi thanks for the article.