用vbs实现本地添加用户的脚本
作者:
这个方法我第一次看到,以前都是用wscript.shell运行,这个是sendkeys方法
Dim WshShell
set WshShell = CreateObject("wscript.Shell")
WshShell.Run "cmd /k"
for i = 1 to 3
WScript.Sleep 500
WshShell.SendKeys "net user admin" & i & " abcd@123 /add"
WshShell.SendKeys "{ENTER}"
next
WshShell.SendKeys "exit"
WshShell.SendKeys "{ENTER}"
set WshShell = CreateObject("wscript.Shell")
WshShell.Run "cmd /k"
for i = 1 to 3
WScript.Sleep 500
WshShell.SendKeys "net user admin" & i & " abcd@123 /add"
WshShell.SendKeys "{ENTER}"
next
WshShell.SendKeys "exit"
WshShell.SendKeys "{ENTER}"