'判断是否重复打开本软件
strComputer="."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colProcessList=objWMIService.ExecQuery ("select * from Win32_Process where Name = 'wscript.exe'")
firstFileStart = False
For Each objProcess in colProcessList
if split(objProcess.CommandLine,"""")(3) = CreateObject("Scripting.FileSystemObject").GetFile(Wscript.ScriptFullName).Path Then
if firstFileStart Then
MsgBox "本程序已经在运行。"
wscript.quit
End If
End If
firstFileStart = True
Next
'先定义一个Shell对象
Set wshShell = WScript.CreateObject("WScript.Shell")
'循环按按键
do
WScript.Sleep 30000
wshShell.SendKeys "{ScrollLock}"
WScript.Sleep 50
wshShell.SendKeys "{ScrollLock}"
loop
禁止锁屏vbs脚本
于 2022-08-02 11:16:22 首次发布