Jump to content

Dos prompt to msgbox help


mcgill
 Share

Recommended Posts

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)

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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?

Cheers

Kurt

__________________________________________________________(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 *

Link to comment
Share on other sites

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 by Joon
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...