windows 不锁屏vb脚本
'普通版:
Set wshShell = WScript.CreateObject("WScript.Shell")
do
WScript.Sleep 300000
wshShell.SendKeys "(ScrollLock}"
loop
'进阶版:
Set wshShell=WScript.CreateObject("WScript.Shell")
dim startTime
dim endTime
dim curTime
dim curWeek
'指定时间区间
startTime = TimeValue("08:30:00")
endTime = TimeValue("18:30:00")
do
curWeek = weekday(Now)
curTime = Time()
WScript.Sleep 300000 '休眠时间单位:毫秒
lf curWeek <> 7 and curWeek <> 1 and curTime >= startTime and curTime <= endTime Then
wshShell.SendKeys "{ScrollLock}"
else
'非工作日,无动作
End lf
loop