可以查询系统用户名sid的vbs
程序员文章站
2022-11-14 10:27:53
复制代码 代码如下:set path=wscript.createobject("wscript.shell") usera=path.expandenvironments...
复制代码 代码如下:
set path=wscript.createobject("wscript.shell")
usera=path.expandenvironmentstrings("%username%")
name=inputbox("请输入你要查询的用户名","sid查询--by不追不悔",usera)
strcomputer = "."
set wbemservices = getobject("winmgmts:\\" & strcomputer)
set wbemobjectset=wbemservices.execquery("select sid from win32_useraccount where name='"&name&"'")
for each mo in wbemobjectset
ssid = mo.sid
next
if(ssid = "")then
wscript.echo "对不起,无此用户"
else
wscript.echo ssid
end if
上一篇: 00HTML
下一篇: vbs字符串分割函数