如何锁机电脑

作者:落知秋 | 创建时间: 2023-05-27
很多人都想把电脑锁住,或者不让别人看到电脑,但一步步操作又太麻烦,所以这里教大家一个方法....
如何锁机电脑

操作方法

首先新建一个记事本

打开.把如下代码粘贴 Const strPassword = "XXX"' 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

注意,第一行中Const strPassword = "XXX"' 引号内容为电脑的密码.可随意更改

保存,退出. 修改后缀名为.VBS

然后双击打开,系统重启.这时已经有了密码了.

温馨提示

请牢记密码.
点击展开全文

更多推荐