思路是分析net user的返回值,然后改成清单
Dim strText as String
Set oShell = CreateObject("WScript.Shell")
Set oExec = oShell.Exec("%COMSPEC% /C ""PING 127.0.0.1""")
Do While Not oExec.StdOut.AtEndOfStream
strText = oExec.StdOut.ReadAll()
Loop
msgbox(strtext)
strText就是就是现在我的net user的返回值
下一步是解析strText
Uname = Split(strText, vbNewLine)
Uname = Split(Uname(4), Space(20))
Uname()数组就是所有的用户名了
后续是一些扩展活动
首先,我要对所有用户的密码进行更改
这个最简单 的方法是直接调cmd,使用net user命令来解决
key ="password"
For i = 1 To UBound(Uname)
Usee = Uname(i - 1)
If Usee <> "Guest" Then
Str = "cmd.exe /c net user " & Usee & " " & Key
Shell Str
End If
Next i