Jump to content
Sign in to follow this  
buzz44

All computer names on network

Recommended Posts

buzz44

howdy all, i know you can use cmd to get a list of all the computer names on your network but is there an autoit function or something i could use to get this list, as i think you can not retrieve text from a cmd window, eg of program like this is winchat.exe which im sure most of you are familiar with, in winchat you click on conversation, then dial, and a box comes up with a drop down tree thing of all the computers on your network and the names of them, is there a way i can get those names to come up in a msgbox or something? i know you can use @ComputerName to get your name but can you get others?


qq

Share this post


Link to post
Share on other sites
Tys

howdy all, i know you can use cmd to get a list of all the computer names on your network but is there an autoit function or something i could use to get this list, as i think you can not retrieve text from a cmd window, eg of program like this is winchat.exe which im sure most of you are familiar with, in winchat you click on conversation, then dial, and a box comes up with a drop down tree thing of all the computers on your network and the names of them, is there a way i can get those names to come up in a msgbox or something? i know you can use @ComputerName to get your name but can you get others?

<{POST_SNAPBACK}>

You can direct the output of "new view" to a file an parse that file, Syntax is:

NET VIEW [\\computername [/CACHE] | /DOMAIN[:domainname]]

NET VIEW /NETWORK:NW [\\computername]

RunWait(@ComSpec & " /c" & "net view /DOMAIN:BLUB > " & @TempDir & "\wslist.tmp", "",)
;--------------Workstation names in array $ws[]
$file_wslist = FileOpen(@TempDir & "\wslist.tmp", 0)
While $erroer <> - 1
    $line = FileReadLine($file_wslist)
    $erroer = @error
    If StringInStr($zeile, "\\") Then
        $ws[$wscount] = StringMid( (StringStripWS($line, 8)), 3)
        $wscount = $wscount + 1
    EndIf
Wend
FileClose($file_wslist)
FileDelete(@TempDir & "\wslist.tmp")

The NetBiosnames are stored in $ws[].

Beware: "Parser"(...) works for the german version of Windows 2000, results may vary with different languages.

hth, Tys

Edited by Tys

Share this post


Link to post
Share on other sites
buzz44

thanks for the reply, can i just compile this script?, i am trying to make a network chat program, much like "net send ip/computer name" in cmd, except in a much more gui style like winchat but not

thanks


qq

Share this post


Link to post
Share on other sites
Tys

thanks for the reply, can i just compile this script?, i am trying to make a network chat program, much like "net send ip/computer name" in cmd, except in a much more gui style like winchat but not

thanks

<{POST_SNAPBACK}>

sure, this is DoWhatYouLike-Code;)

/Edit

You should not trust the generated list too much, Windows tends to keep dead Computers in the nertworkneighborhood for max. 20 Minutes, so do a

"If Ping($ws[], 30) Then" or similar before you try to connect to any of the workstations.

Edited by Tys

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.