简体   繁体   English

VBS脚本错误800A03F4

[英]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.

相关问题 Windows 脚本宿主错误:无效字符 - 代码:800A03F6 - 来源:Microsoft JScript 编译错误 - Windows Script Host Error: Invalid character - Code:800A03F6 - Source: Microsoft JScript compilation error 运行“nodemon index.js”启动 Windows 脚本主机而不是 VS:WSH 错误代码 800A03F6 - Running "nodemon index.js" launches Windows Script Host instead of VS: WSH Error Code 800A03F6 VBScript预计结束800A03F6 - VBScript Expected End 800A03F6 Windows桌面VB.Net Apps由于应用程序事件日志中的0xC004F057而导致读取Excel 1004 0x800A03EC错误 - Windows Desktop VB.Net Apps Getting an error 1004 0x800A03EC reading Excel due to 0xC004F057 in Application Event log .NET 框架错误 x800f081f - .NET framework error x800f081f 无法在 VBS 事件监视脚本中检测到不可解析的错误 - Unable To Detect Unparsable Error In VBS Event Watching Script 在 Windows 10 上安装 IIS 时出现错误 0x800f0922:“无法完成更改。” - Error 0x800f0922 when installing IIS on Windows 10: “The changes couldn't be completed.” 错误代码:0x800f0954 在 windows 11 上安装 .net framework 3.5(解决方案) - Error Code: 0x800f0954 installing .net framework 3.5 on windows 11 (Solution) 2015年3月8日此时是意外的批处理脚本错误 - 03/08/2015 was unexpected at this time batch script error 用于 Windows 更新的 VBS 脚本 - VBS Script for Windows Update
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM