From: Bill on 7 May 2010 13:33 hello I've got series of VB scripts that I run manually buy clicking on them, Can't I have one script that runs all of them? I would want to check a returned variable to is one script has a failure, the later one won't get executed. Can't I just use the .Run method? How do I return a value from one script, and read it in the other script? Thanks
From: Pegasus [MVP] on 7 May 2010 13:53 "Bill" <someplace(a)somewhere.com> wrote in message news:e72gZtg7KHA.5644(a)TK2MSFTNGP04.phx.gbl... > hello > > I've got series of VB scripts that I run manually buy clicking on them, > > Can't I have one script that runs all of them? I would want to check a > returned variable to is one script has a failure, the later one won't get > executed. Can't I just use the .Run method? How do I return a value from > one script, and read it in the other script? > > Thanks This is very much the domain of batch files, e.g. like so: @echo off cscript //nologon c:\scripts\script1.vbs || goto :eof cscript //nologon c:\scripts\script2.vbs || goto :eof cscript //nologon c:\scripts\script3.vbs || goto :eof cscript //nologon c:\scripts\script4.vbs || goto :eof To flag a failure, you would terminate each script with wscript.quit x If x > 0 then the batch file will terminate. Alternatively you could use the Exec method repeatedly, then check the ExitCode each time. It's more involved but it will work. And lastly you could turn each of your programs into a subroutine of your master VB Script.
|
Pages: 1 Prev: VBscript problem with Windows 7 Next: Looking for a name within a string |