![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-08-11 08:49 |
47,811 topics / 349,897 posts / today 0 new / 48,256 members |
| DOS批处理 & 脚本技术(批处理室) » [Help] Asking an expert to help write a batch file to add users in bulk with custom quantity and names |
| Printable Version 694 / 5 |
| Floor1 mzszwh | Posted 2009-02-09 00:03 |
| 新手上路 Posts 10 Credits 15 | |
|
Batch file for adding users in bulk:
FOR /L %%i in (1,1,30) DO NET USER abc%%i 123456 /ADD The above can only add a fixed quantity, prefix, and password. Can it be changed so the above content can be entered manually? That is, after running the batch file, manually enter the number of users to add == |
|
| Floor2 不得不爱 | Posted 2009-02-09 00:12 |
| 超级版主 Posts 2,044 Credits 5,310 From 四川南充 | |
|
Like this?
set/p sl=Please enter the number of users to add: FOR /L %%i in (1,1,%sl%) DO NET USER abc%%i 123456 /ADD |
|
| Floor3 mzszwh | Posted 2009-02-09 01:42 |
| 新手上路 Posts 10 Credits 15 | |
|
Yes, can all 3 parameters be made like this?
Number of users, username prefix, user password |
|
| Floor4 mzszwh | Posted 2009-02-09 01:44 |
| 新手上路 Posts 10 Credits 15 | |
|
At the moment I use it like this:
FOR /L %%i in (1,1,30) DO NET USER abc%i 123456 /ADD FOR /L %%i in (1,1,30) DO net localgroup administrators abc%i /add First add 30 users, then add all 30 users to the administrators group Thanks to the moderator for the help |
|
| Floor5 不得不爱 | Posted 2009-02-09 11:25 |
| 超级版主 Posts 2,044 Credits 5,310 From 四川南充 | |
|
All of that is possible!
set/p sl=Please enter the number of users to add: FOR /L %%i in (1,1,%sl%) DO NET USER abc%%i 123456 /ADD FOR /L %%i in (1,1,%sl%) DO net localgroup administrators abc%%i /add |
|
| Floor6 mzszwh | Posted 2009-02-09 22:42 |
| 新手上路 Posts 10 Credits 15 | |
|
Can the username prefix and password be added too?
|
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |