Adding & Deleting Users & Group

Discussion in 'Windows' started by ghostomni, Oct 17, 2007.

  1. ghostomni

    ghostomni New Member

    Joined:
    Jul 1, 2007
    Messages:
    31
    Likes Received:
    1
    Trophy Points:
    0
    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
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    Looks good but not for Vista and so I could not see it.
     
  3. Izaan

    Izaan New Member

    Joined:
    Oct 16, 2007
    Messages:
    215
    Likes Received:
    2
    Trophy Points:
    0
    Thanks for sharing.
     
  4. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
  5. gprabhu

    gprabhu New Member

    Joined:
    Aug 16, 2007
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    0
    Hi!
    Very useful program.
    Thanks a lot!
     
  6. arslan220

    arslan220 New Member

    Joined:
    Mar 17, 2007
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    0
    hi thanks for the article.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice