最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
批量创建win帐号的脚本程序
时间:2022-06-30 11:20:34 编辑:袖梨 来源:一聚教程网
很久以前做压力测试,模拟多用户访问,批量创建win帐号的脚本程序.文件名为 createuser.js,运行命令是:
createuser.js /user:share /password:qazw /start:1 /count:120
function run()
{
WshShell = WScript.CreateObject("WScript.Shell")
//msg = WshShell.run("net user share1 qazw /ADD",1,true)
var argsUnnamed = WScript.Arguments.Named;
var count = argsUnnamed("count")
userName = argsUnnamed("user")
password = argsUnnamed("password")
start = argsUnnamed("start")
if(start ==null)
{
start=1
}
else
{
start=parseInt(start)
}
if(userName==null)
{
WScript.Echo("no userName")
return
}
if(password==null)
{
WScript.Echo("no password")
return
}
if(count==null)
{
WshShell.run("net user "+ userName +" " + password + " /delete",1,true)
}
else
{
count=parseInt(count)
var i =0;
for( ;i {
WshShell.run("net user "+ userName+(start+i)+" " + password + " /ADD",0)
}
}
}
run()
//WshShell.Popup(msg)
createuser.js /user:share /password:qazw /start:1 /count:120
function run()
{
WshShell = WScript.CreateObject("WScript.Shell")
//msg = WshShell.run("net user share1 qazw /ADD",1,true)
var argsUnnamed = WScript.Arguments.Named;
var count = argsUnnamed("count")
userName = argsUnnamed("user")
password = argsUnnamed("password")
start = argsUnnamed("start")
if(start ==null)
{
start=1
}
else
{
start=parseInt(start)
}
if(userName==null)
{
WScript.Echo("no userName")
return
}
if(password==null)
{
WScript.Echo("no password")
return
}
if(count==null)
{
WshShell.run("net user "+ userName +" " + password + " /delete",1,true)
}
else
{
count=parseInt(count)
var i =0;
for( ;i
WshShell.run("net user "+ userName+(start+i)+" " + password + " /ADD",0)
}
}
}
run()
//WshShell.Popup(msg)
相关文章
- 无期迷途主线前瞻直播总结 无期迷途主线前瞻直播内容介绍 11-22
- 以下哪种非遗技艺是用针在纸上绣画 蚂蚁新村11月21日答案 11-22
- 江南百景图听风塔怎么样 11-22
- 原神恰斯卡圣遗物怎么搭配 11-22
- 2024年霸王茶姬11月22日口令是什么 2024.11.22霸王茶姬口令介绍 11-22
- 光遇11.21季节蜡烛在哪里 光遇11月21日季节蜡烛位置攻略 11-22