mhillmer
12-09-2007, 22:35
I searched and didn't find many posts on OS_ShellExecute, and the manual only has minimal information on this. I'm assuming the information returned from it is NOT the output, but rather some sort of status code (I get "42" back from nbtscan.exe, and I don't think this is the answer I'm looking for!).
Is the only way to capture the output of a command line executable to redirect to the output to a file and then read in the file? (painful if you are running lots of commands!)
This is what I'm trying to run:
USES "File"
uses "Console"
uses "OS"
Dim FileToLoad as integer
dim MyArray() as asciiz
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)
for CountLine = 1 to nLines
sTemp = OS_SHELLEXECUTE ( "open", "nbtscan.exe", MyArray(CountLine,2) + "/24", "", %OS_WNDSTYLE_NORMAL)
console_writeline(sTemp)
next
Thanks,
Matt
Is the only way to capture the output of a command line executable to redirect to the output to a file and then read in the file? (painful if you are running lots of commands!)
This is what I'm trying to run:
USES "File"
uses "Console"
uses "OS"
Dim FileToLoad as integer
dim MyArray() as asciiz
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)
for CountLine = 1 to nLines
sTemp = OS_SHELLEXECUTE ( "open", "nbtscan.exe", MyArray(CountLine,2) + "/24", "", %OS_WNDSTYLE_NORMAL)
console_writeline(sTemp)
next
Thanks,
Matt