Matt,
what about this one:
[code=thinbasic]
USES "File"
uses "Console"
uses "OS"
Dim FileToLoad as integer
dim MyArray() as string '<<<<< Changed to STRING. ASCIIZ are used only with fized size usually
dim nLines as long
dim nCols as long
dim CountLine as long
dim CountCol as long
dim sTemp AS ASCIIZ
Console_Writeline("Test Console App")
REM Stores.csv is a list of StoreNumber,VLAN1IPAddress,VLAN2IPAddress
PARSE(FILE_Load("M:\Misc\Matt\CanadianInventory\Data\Stores.csv"), MyArray(), $crlf , ",")
nLines = ubound(MyArray(1))
nCols = ubound(MyArray(2))
console_writeline("Total number of lines : " & nLines)
console_writeline("Total number of colums: " & nCols)
'---This will contain the full captured buffer
dim sBuffer as string
for CountLine = 1 to nLines
OS_Shell(OS_ENVIRON("COMSPEC") & " /C " & app_sourcepath & "nbtscan.exe " & MyArray(CountLine,2) & "/24 > " & app_sourcepath & "__Out__.txt", %OS_WNDSTYLE_HIDE, %OS_SHELL_SYNC)
'---At every RUN, output will be deleted, so we accumulate into sBuffer
sBuffer += file_load(app_sourcepath & "__Out__.txt") & repeat$(80, "-") & $crlf
next
'---At the end, sBuffer will contain the full scan
msgbox 0, sBuffer
[/code]
Capturing the output buffer is not so trivial. We need to create a process manually using Win32 API telling we want to have stdout captured into a file handle. Than we need to create a new file handle, close at the end, get the output manually, ...
Much better it seems to me to have a output file redirection into a temp file. When OS_SHELL finish, capture the output and a new loop with a different net scan will start.
What do you think?
Ciao
Eros
Bookmarks