mcgill Posted November 30, 2006 Posted November 30, 2006 I need some help sending the data I get from the dos prompt to my msgbox, right now its pulling my temp files. I think my run line is screwed up. I want to run the sql line and then export the data to a msgbox. Any help would be great, thanks $hRun = Run (@comspec & " /c DIR osql -U sa -P -d Insync -Q " & $Sign & "sp_databases" & $Sign, @TempDir, @SW_SHOW, $STDOUT_CHILD) ; Read output $sOutput = "" While 1 $sOutput &= StdOutRead($hRun) If @error Then ExitLoop Sleep(50) WEnd ; Display results MsgBox(64, "Results", $sOutput)
mcgill Posted November 30, 2006 Author Posted November 30, 2006 k, now i got it to work to send my data to the msgbox, is there a way I can clean it up to make it look pretty with the titles? $hRun = Run ("C:\Documents and Settings\amcgill\Desktop\list.bat", "", @SW_SHOW, $STDOUT_CHILD) ; Read output $sOutput = "" While 1 $sOutput &= StdOutRead($hRun) If @error Then ExitLoop Sleep(50) WEnd ; Display results MsgBox(64, "Results", $sOutput)
/dev/null Posted November 30, 2006 Posted November 30, 2006 k, now i got it to work to send my data to the msgbox, is there a way I can clean it up to make it look pretty with the titles?how does it look like if you redirect the output into a file?CheersKurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *
mcgill Posted November 30, 2006 Author Posted November 30, 2006 Looks the same when I export to a file, is there a way to set width on a inputbox or msgbox so it displays correctly?
Joon Posted November 30, 2006 Posted November 30, 2006 (edited) This is what I do to get rid of extra lines. #include <Constants.au3> $foo = Run(@ComSpec & " /c ipconfig", @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) $IPConfig = "" While 1 $line = StringSplit(StdoutRead($foo), @CRLF) If @error Then ExitLoop For $i = 1 To UBound($line) - 1 If $line[$i] <> "" Then $IPConfig &= $line[$i] & @LF Next WEnd MsgBox(0, "", $IPConfig) Edited November 30, 2006 by Joon
mcgill Posted November 30, 2006 Author Posted November 30, 2006 When I run this code it works but when I run it with the statement I had or point to a patch file the msgbox is empty.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now