Hi,
I'm a newbie and I have wrote a vb script that I want my computer to run frequently. The script just checks for the existence of a file (which will rarely be there) and it runs another script when it does exist. Right now I have windows task scheduler running the script every 1 minute. I would like a fairly fast response here, but I don't know what is practical. Another idea I had was to make my script run at start up and just loop indefinitely.
Should I be worried about my computer running this thing all the time?
I tried to make the script impossible to give errors but hey, what do I know... Should I be worried about error messages popping up onto the computer 10 million times and crashing?
Please give me some advice here on how to run this thing efficiently.
Thanks!
option explicit
dim wshShell, objFSO, object
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists("C:\YesRun.Toggle") Then
If objFSO.FileExists("C:\RunScriptOnce.bat") Then
Set wshShell = WScript.CreateObject("WSCript.shell")
wshshell.run "C:\RunScriptOnce.bat > output.txt", False
Set object = CreateObject("Scripting.FileSystemObject")
object.MoveFile "C:\YesRun.Toggle" , "C:\NoRun.Toggle"
End If
End If
set wshshell = nothing
set objFSO = nothing
set object = nothing
<message edited by johnBroecher on Monday, May 23, 2011 3:11 PM>