Click to See Complete Forum and Search --> : Executing a VBScript from VB and speed


Kdev
May 18th, 2001, 02:06 PM
I am executing the script like this:

Dim wshShell
set wshShell = CreateObject("WScript.Shell")
wshShell.Run "wscript tmp001.vbs", 0, true



This will run the script and wait until finished before continuing.

The script file looks like this:

Dim objFS
Dim objFile
Dim objTS

If ( true OR false) AND ( false OR false OR false) AND ( false OR false) AND ( true) then
set objFS = CreateObject("Scripting.FileSystemObject")
set objFile = objFS.GetFile("c:\temp\output.txt")
set objTS = objFile.OpenAsTextStream(2)
objTS.WriteLine ("1")
objTS.Close
set objFS = nothing
else
set objFS = CreateObject("Scripting.FileSystemObject")
set objFile = objFS.GetFile("c:\temp\output.txt")
set objTS = objFile.OpenAsTextStream(2)
objTS.WriteLine ("0")
objTS.Close
set objFS = nothing
End If



Is there anyway I can clean this up to make it run a bit faster for now?

-K