Jump to content

net view Array display


realkiller
 Share

Recommended Posts

i made this script, the only thing i couldn't achief is making it in a array can somone help:) thx

#include <array.au3>
#include <Constants.au3>


Dim $line
$foo = Run(@ComSpec & " /c net view ", "",@SW_Hide, $STDOUT_CHILD)
$count = 1
While 1
    $line &= StdoutRead($foo) & @CRLF
    If @error Then ExitLoop
    $count +=1
Wend

MsgBox (0, "", $line)
Link to comment
Share on other sites

fixing your code to an array....

#include <array.au3>
#include <Constants.au3>


Dim $line[2]
$foo = Run(@ComSpec & " /c net view ", "",@SW_Hide, $STDOUT_CHILD)
$count = 1

While 1
    $iTemp = StdoutRead($foo)
    If @error Then ExitLoop
    $line[$count] = StringReplace($iTemp, @CRLF, "")
    $count +=1
    ReDim $line[$count + 1]
Wend

_ArrayDisplay($line, "Info")

8)

NEWHeader1.png

Link to comment
Share on other sites

Another appraoch to utilizing arrays

#include <array.au3>
#include <Constants.au3>

Dim $line = _ArrayCreate("")
$foo = Run(@ComSpec & " /c net view ", "",@SW_Hide, $STDOUT_CHILD)

While 1
    $iTemp = StdoutRead($foo)
    If @error Then ExitLoop
    _ArrayAdd( $line, StringReplace($iTemp, @CRLF, ""))
Wend

_ArrayDisplay($line, "Info")

... just bored..lol

8)

NEWHeader1.png

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...