Re: get list of computer names attached to the network

From: beluga (beluga.13kdjj_at_mail.mcse.ms)
Date: 03/23/04


Date: Tue, 23 Mar 2004 02:48:12 -0600


RichB wrote:
> *How do I write a vb script, that return the names of each
> computer attched to my network? *
Active Directory is non sense if you keep computer accounts in
different OUs.I use net view in coord with vbs.Just create a shell
object and run net view,redirect output to a txt file and read the
contents line by line,first check if line contains "\\"
characters.Thats the way i use it.

Set objShell = CreateObject("WScript.Shell")
objShell.Run "%COMSPEC% /k net view > c:\netview.txt"

'Sleep time necessary
WScript.Sleep 1000
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("c:\netview.txt", 1)
inputData = Split(objFile.ReadAll, vbNewline)
For each strData In inputData
If InStr(strData,"\\") then
data=split(strData," ")
strComputer =data(0)
liste=liste&strcomputer&vbcrlf
Next
something like this,should work

--
beluga
------------------------------------------------------------------------
Posted via http://www.mcse.ms
------------------------------------------------------------------------
View this thread: http://www.mcse.ms/message490288.html
 


Relevant Pages

  • Capturing lonon name while someone is being logged on
    ... Could you please let me know if we can capture the logon ... I am trying to write the generic script that runs in the ... Active Directory in Win 2000 Server. ... network resources like printers and drives and so on. ...
    (microsoft.public.windows.server.scripting)
  • Re: Capturing lonon name while someone is being logged on
    ... > name using windows scripting technologies while someone is ... > being logged on to the network (Active Directory). ... > I am trying to write the generic script that runs in the ... > network resources like printers and drives and so on. ...
    (microsoft.public.windows.server.scripting)
  • Re: get list of computer names attached to the network
    ... >Active Directory is non sense if you keep computer ... >different OUs.I use net view in coord with vbs.Just ... >For each strData In inputData ...
    (microsoft.public.windowsxp.wmi)
  • neural networks
    ... I have a modelling problem with my neural network. ... that the standard NN, like a backpropagation network, uses ... transferfunctions that in some way compute output directly from the ... In my case the targetdata has nothing to do with the inputdata, ...
    (comp.soft-sys.matlab)