vbs里面调用 ChangePassword返回13是什么意思?
验证用户的密码正确与否
On Error Resume Next
Set objNetwork = CreateObject("Wscript.Network")
strComputer = objNetwork.ComputerName
Set colAccounts = GetObject("WinNT://" & strComputer)
colAccounts.Filter = Array("user")
uId1 = "user1"
uId2 = "user2"
pwd1 = "8"
pwd2 = "7"
'验证第一个用户 uId1
For Each objUser In colAccounts
if Lcase(objUser.Name) = Lcase(uId1) then
objUser.ChangePassword pwd1 ,pwd1
msgbox Err
Err.Clear
break
End if
Next
'验证第二个用户 uId2
For Each objUser In colAccounts
if Lcase(objUser.Name) = Lcase(uId2) then
objUser.ChangePassword pwd2 ,pwd2
msgbox Err
Err.Clear
break
End if
Next
第一个用户验证Ok err确实是返回 0
第二个用户咋返回 13 ???
谁能告诉我返回13是什么意思?
[解决办法]
类型不匹配
[解决办法]
Lcase(objUser.Name) = Lcase(uId2)
不匹配