Sign in to follow this  
Followers 0
mcgill

Dos prompt to msgbox help

6 posts in this topic

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)

Share this post


Link to post
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)

Share this post


Link to post
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 *

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

#5 ·  Posted (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 by Joon

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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
Sign in to follow this  
Followers 0