@echo off %1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit cd /d "%~dp0" :menu cls net user title 账户管理 echo. @echo -------------------------------------------1)添加账号-------------------- @echo -------------------------------------------2)删除账号-------------------- @echo -------------------------------------------3)修改密码-------------------- @echo -------------------------------------------4)删除账户管理员权限---------- @echo -------------------------------------------5)添加管理员权限-------------- @echo -------------------------------------------6)查看账号-------------------- @echo -------------------------------------------7)退出------------------------ echo. set /p c= 输入你的选择: echo. if '%c%'=='1' goto :go if '%c%'=='2' goto :del if '%c%'=='3' goto :update if '%c%'=='4' goto :clear if '%c%'=='5' goto :insert if '%c%'=='6' goto :select if '%c%'=='7' goto :close :go set /p name=-------------输入账号: set /p pwd=--------------输入密码: net user %name% %pwd% /add goto :admin :del set /p de=输入要删除的账号: net user %de% /del pause goto:menu :admin set /p ad=是否添加为管理员(输入Y或N): if '%ad%'=='y' goto :add cls goto :menu :add net localgroup administrators %name% /add pause cls goto:menu :update set /p names=输入要修改的账户(不输入则默认为当前账户): set /p pwd=输入要修改的密码: set /p pwds=确认密码: if '%names%'=="" goto :default if %pwd%==%pwds% goto:pwd goto:no :pwd net user %names% %pwds% pause cls goto menu :no echo.------------------两次密码不一致,请重新输入----------------- pause cls goto menu :default net user %username% %pwds% pause cls goto menu :close eixt :clear set /p name=输入要删除权限的账户: net localgroup administrators %name% /delete echo 管理员权限已删除 pause :menu :insert set /p name=输入要添加权限的账户: net localgroup administrators %name% /add pause cls goto:menu :select set /p name=输入要查看的账户: net user %name% pause cls goto:menu ::原创