scripting - VBScript:第 1 行字符 1 中的无效字符 800A0408 编译错误
问题描述
你好,我是新手,它说这个[在此处输入图像描述][1]
[1]:https ://i.stack.imgur.com/9s5SW.png 这是脚本
do
wscript.sleep 100
wshshell.sendkeys “{CAPSLOCK}”
wshshell.sendkeys “{NUMLOCK}”
wshshell.sendkeys “{SCROLLLOCK}”
loop```
解决方案
您的脚本中有智能引号。在编码时尽量避免它们。
将它们更改为直引号:
Debug.Print "Start"
Set wshshell = CreateObject("WScript.Shell")
ctr = 1
Do
Debug.Print "Loop " & ctr
wscript.Sleep 1000 ' one second
wshshell.SendKeys "{CAPSLOCK}"
wshshell.SendKeys "{NUMLOCK}"
wshshell.SendKeys "{SCROLLLOCK}"
ctr = ctr + 1
Loop
推荐阅读
- reactjs - 在生产服务器上使用 React 定义 API 目的地
- python - Python datetime.strptime 似乎接受长度无效的输入
- python - 将两个字符串的串联附加到列表中
- postgresql - 具有松散返回数据类型的 PostgreSQL 函数
- swift - MongoKitten:检查 ObjectId 是否存在
- ruby-on-rails - 将表 A 中的 SUM 添加到表 B 的单个列中
- symmetric - 对对称密码学的蛮力攻击
- python - 关闭本地机器后,继续在 jupyter notebook 中远程运行一个单元
- c# - 从字符串列表创建列表
- r - 根据列号为每一行应用一个函数