#7292

kenny
Member

I’m getting somewhere, but not quite there yet.
Using vb rather than jscript [code below]
It doesn’t seem to like the ReadAll lines.
I can’t find any reference to this in the help file. Maybe I should be looking at some vbscript references instead.

Any thoughts?

sServer = prompt(“Enter Server”, “MyServer”)
sDatabase = prompt(“Enter Database”, “MyDB”)
sFileName = “MyFile.sql”
sCmdline = “-w””2000″” -S””” + sServer + “”” -E -d””” + sDatabase + “”” -n -t28800 -I -i””” + sFileName + “”””

set wsh = CreateObject(“WScript.Shell”)
wExec = wsh.Run(“osql.exe ” + sCmdline)

OutputBar.Visible = true
OutputBar.SetFocus()
OutputBar.writeln(“——–“)
OutputBar.write(wExec.StdOut.ReadAll())
OutputBar.write(wExec.StdErr.ReadAll())