Advertisement
adamchilcott

manageUsers.cmd

Aug 19th, 2018
384
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 1.27 KB | None | 0 0
  1. @echo off
  2.  
  3. cls
  4.  
  5. setlocal
  6.  
  7. REM ###############################
  8. REM # Day-to-Day Account Management
  9. REM ###############################
  10.  
  11. :mainMenu
  12. echo.
  13. echo YOU MUST RUN THIS AS AN ADMINISTRATOR
  14. echo.
  15. echo #####################################
  16. echo # 1. Remove an Account
  17. echo # 2. Change an Account Password
  18. echo # 3. Create an Administrative Account
  19. echo # 4. Drop Back To A Command Prompt
  20. echo #####################################
  21. echo.
  22.  
  23. set /p varChoice="Enter An Option: "
  24.  
  25. if %varChoice%==1 goto :removeAccount
  26. if %varChoice%==2 goto :changePassword
  27. if %varChoice%==3 goto :addAdminAccount
  28. if %varChoice%==4 goto :eof
  29.  
  30. :removeAccount
  31. set /p varUser="Please Enter A UserName e.g. uname: "
  32.  
  33. net user %varUser% /delete
  34.  
  35. :changePassword
  36. set /p varUser="Please Enter A UserName e.g. uname: "
  37. set /p varPassword="Please Enter A Password e.g. 1myPassword: "
  38.  
  39. net user %varUser% %varPassword%
  40.  
  41. :addAdminAccount
  42. set /p varUser="Please Enter A UserName e.g. uname: "
  43. set /p varPassword="Please Enter A Password e.g. 1myPassword: "
  44.  
  45. net user %varUser% %varPassword% /add
  46. net localgroup administrators %varUser% /add
  47.  
  48. goto :mainMenu
  49.  
  50. endlocal
  51.  
  52. REM #############
  53. REM # START NOTES
  54. REM #############
  55.  
  56. REM ###########
  57. REM # END NOTES
  58. REM ###########
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement