标题: [问题求助] VBS如何自动获取当前用户的账户并自动修改密码? [打印本页]
作者: wd4455 时间: 2018-12-11 11:18 标题: VBS如何自动获取当前用户的账户并自动修改密码?
我原使用的脚本如下,但是只是做的固定账户脚本.
希望能改成修改当前用户的密码,同时开机自动运行。- strPassword = right("0"&weekday(now()),8)
- select case strPassword
- '星期一至星期天
- case 1 psw="123"
- case 2 psw="123"
- case 3 psw="123"
- case 4 psw="123"
- case 5 psw="123"
- case 6 psw="123"
- case 7 psw="123"
- end select
- Dim WshNetwork
- Set WshNetwork = CreateObject("WScript.Network")
- Dim UserName
- UserName = WshNetwork.UserName&",user"
- Dim Domain
- Set Domain = GetObject("WinNT://./"&UserName)
- Domain.SetPassword psw
- Domain.SetInfo
-
- 'msgbox psw
复制代码
作者: wd4455 时间: 2019-1-10 09:58
百度的结果
1
dim wsnet
set wsnet=wscript.createobject("wscript.network")
msgbox wsnet.username
2
<script language="JavaScript">
//取得机器名,登录域及登录用户名
function getusername()
{
var WshNetwork = new ActiveXObject("WScript.Network");
alert("登录名 = " + WshNetwork.UserDomain);
alert("计算机名 = " + WshNetwork.ComputerName);
alert("用户名 = " + WshNetwork.UserName);
}
</script>
<a onclick="javascript:getusername();">点我</a>
保存成htm文件
3
<%use=request.servervariables("LOGON_USER")
response.write ("use")%>
你将它转化成变量不是可以在客户端调用了?
我都不记得,曾经学过ASP 。。
求高手修改下..
作者: ivor 时间: 2019-1-10 17:04
- $WeekDay = @{
- Monday = "1"
- Tuesday = "2"
- Wednesday = "3"
- Thursday = "4"
- Friday = "5"
- Saturday = "6"
- Sunday = "7"
- }
- net user $env:USERNAME $WeekDay[(Get-Date).DayOfWeek.ToString()]
复制代码
欢迎光临 批处理之家 (http://bbs.bathome.net/) |
Powered by Discuz! 7.2 |