So I have a script that is called within a VB app. When I let it run alone, there is no problem. However, when I start to click around in Windows, several instances of the script fire. I end up going to task manager to kill jobs. It's as though the scrpit needs to have complete focus.
What can I do to prevent it from running many different instances of the script.
Below is the beginnings of the script. The extention of the file is vbs.
Option Explicit
On Error Resume Next
Dim WshShell
Set WshShell=CreateObject("WScript.Shell")
WshShell.run "cmd.exe"
WScript.Sleep 1000