如何每10秒打开一个程序

时间:2015-10-24 13:37:23

标签: vbscript

我试图通过创建一个每10秒打开一次记事本的VBScript来对我的朋友进行恶作剧。我能够制作脚本,但它第一次打开记事本,但在10秒后,脚本会再次打开它,我收到此错误:

enter image description here

我的VBS代码:

Dim oShell
Set oShell = CreateObject("WScript.Shell")
i = 0
Do While i = 0
oShell.run "Notepad.exe"
Set oShell = Nothing
WScript.Sleep(10000)
Loop

1 个答案:

答案 0 :(得分:2)

在同时享受一点乐趣的同时,我没有看到学习新东西的任何错误;) 您的问题是,在not_bad OK got: 'This movie is good' expected: 'This movie is good' X got: 'This dinner is good' expected: 'This dinner is good!' OK got: 'This tea is not hot' expected: 'This tea is not hot' OK got: "It's bad yet not" expected: "It's bad yet not" 设置为Notepad.exe时,您尝试执行oShell。只需删除该行,一切都应该是好的。

Nothing