zoukankan      html  css  js  c++  java
  • VBS修改本机的账号密码

     On Error Resume Next 
    
    strComputer = "." 
    Set WshShell = WScript.CreateObject("WScript.Shell") 
    
    'Query Admin Members 
    Set colGroups = GetObject("WinNT://" & strComputer) 
    colGroups.Filter = Array("group") 
    For Each objGroup In colGroups 
    'check the administrators local group members.. 
    If (InStr(1,objGroup.Name,"Administrators",1) >0) Then 
    For Each objUser in objGroup.Members 
    strUSER=strUSER &vbCrLf& objuser.class &"="& objUser.name 
    next 
    End If 
    Next
    
    sUser=InputBox("请输入您要修改的账户","修改账户","zhaojianlu")
    Set objUser = GetObject("WinNT://" & strComputer & "/" & Chr(34) & sUser & Chr(34)) 
    sPass=InputBox("请输入您要修改的密码","修改密码","123456")
    objUser.SetPassword sPass 
    objUser.Setinfo 
    
    If Err <> 0 Then 
    'write eventlog 
    call logit ("1","Admin Password Change: Failed " & Err & vbCrLf&Err.Description _ 
    &vbCrLf&Err.Source &vbCrLf& strUSER) 
    MsgBox "密码修改失败,请确认您有管理员权限。"
    Else 
    call logit ("0","Admin Password Change: Successfull") 
    MsgBox "密码修改成功"
    End if 
    
    
    '******************************* 
    Function logit(strStatus,strDescription) 
    WshShell.LogEvent strStatus,strDescription 
    End Function
    

       欢迎加入QQ技术群聊:70539804

  • 相关阅读:
    老话题之C#写邮件发送
    MVC readioButtonList的创作过程及运用
    asp.net发送短信
    关于MVC打印问题,打印指定的内容
    Java WebSocket HttpSession与WebSocket Session的关联
    JUnit accuracy/failure/stress test区别
    JUnit pass/failure/error区别
    Eclipse 重构
    Java 注释
    Java API概述
  • 原文地址:https://www.cnblogs.com/boltkiller/p/4791786.html
Copyright © 2011-2022 走看看