[英]VBS script error 800A03F4
I am getting this error when I am trying to make a custom screensaver. 尝试制作自定义屏幕保护程序时出现此错误。 It says: (script location) Line: 20 Char: 4 Error: Expected "If" and when I chane it it also says expected end or something else. 它说:(脚本位置)行:20字符:4错误:预期为“ If”,当我对其进行渲染时,它还表示预期结束或其他内容。 The idea is to launch a screensaver I have made in a .bat script and it will detect when to launch it. 这个想法是启动一个用.bat脚本制作的屏幕保护程序,它将检测何时启动它。 Also, could I also have some help detecting that the mouse isn't moved for the time specified? 另外,我还能在检测到鼠标在指定时间内没有移动时提供帮助吗? Anyway, here is what I have done so far: 无论如何,这是我到目前为止所做的:
set service = GetObject ("winmgmts:")
Dim StartTime, EndTime, Elapsed
StartTime = Timer
Elapsed = Timer - StartTime
If Timer > 100000 Then
for each Process in Service.InstancesOf ("Win32_Process")
If Process.Name = "cmd.exe" then
sleep 0
else
createObject("WScript.Shell").Run "screensaver.bat"
StartTime = 0
EndTime = 0
Elapsed = 0
Timer = 0
end
thanks in advance ~ Dan 在此先感谢〜丹
The default If
statement is 默认的If
语句是
If True Then
WScript.Echo "True"
End If
If you delete the If
in End If
, you get the Expected 'If' error. 如果删除If
End If
,则会出现预期的“ If”错误。
In your code you 'open' two Ifs and one For. 在您的代码中,您“打开”了两个If和一个For。 Close them properly and indent your code. 正确关闭它们并缩进代码。
I have updated the script so it launches the screensaver properly, but still doesn't detect idle time and the timer doesn't really work. 我已经更新了脚本,因此它可以正常启动屏幕保护程序,但是仍然无法检测到空闲时间,并且计时器也不能真正起作用。 I changed the script. 我更改了脚本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.