关闭正在运行的VBScript程序

关闭正在运行的VBScript程序,vbscript,message,Vbscript,Message,(这是一个.vbs程序)我正在尝试为一个程序创建一个消息bot,但我遇到了一个问题,如果您将时间设置得太长,消息数量设置得太高,则无法轻松停止该程序,并且必须处理一遍又一遍地键入的消息,直到消息完成。有没有办法在邮件运行时添加一个选项来阻止邮件被键入? 代码如下: set shell = createobject ("wscript.shell") strtext = inputbox ("Type the message you like to type") strtimes = input

(这是一个.vbs程序)我正在尝试为一个程序创建一个消息bot,但我遇到了一个问题,如果您将时间设置得太长,消息数量设置得太高,则无法轻松停止该程序,并且必须处理一遍又一遍地键入的消息,直到消息完成。有没有办法在邮件运行时添加一个选项来阻止邮件被键入? 代码如下:

set shell = createobject ("wscript.shell")

strtext = inputbox ("Type the message you like to type")
strtimes = inputbox ("How many times would you like to type this message?")
strspeed = inputbox ("How fast do you like to message? (1000 = one per sec, 100 = 10 per sec etc)")
strtimeneed = inputbox ("How many SECONDS do you need to get to your input box?")
If not isnumeric (strtimes & strspeed & strtimeneed) then
msgbox "You entered something else then a number on Times, Speed and/or Time need. Closing program"
wscript.quit
End If
strtimeneed2 = strtimeneed * 1000
do
msgbox "You have " & strtimeneed & " seconds to get to your input area where you are going to message."
wscript.sleep strtimeneed2
shell.sendkeys ("Hello" & "{enter}")
for i=0 to strtimes
shell.sendkeys (strtext & "{enter}")
wscript.sleep strspeed
Next
shell.sendkeys ("Bye" & "{enter}")
wscript.sleep strspeed * strtimes / 10
returnvalue=MsgBox ("Want to send the messages again with the same info?",36)
If returnvalue=6 Then
Msgbox "Ok Messagebot will activate again"
End If
If returnvalue=7 Then
msgbox "Messaging is shutting down"
wscript.quit
End IF
loop

您只需设置一个快捷方式即可终止所有正在运行的
wscript.exe
进程。在桌面上单击鼠标右键,在关联菜单中选择“新建-快捷方式”:

输入
%comspec%/c taskkill/f/im wscript.exe
作为位置,然后单击下一步:

输入您喜欢的名称,然后单击“完成”:


您也可以在快捷方式属性中指定热键。

您只需设置一个快捷方式即可终止所有正在运行的
wscript.exe
进程。在桌面上单击鼠标右键,在关联菜单中选择“新建-快捷方式”:

输入
%comspec%/c taskkill/f/im wscript.exe
作为位置,然后单击下一步:

输入您喜欢的名称,然后单击“完成”:


您也可以在快捷方式属性中指定热键。

这真的很有帮助,我感谢您的帮助这真的很有帮助,我感谢您的帮助