Re: get list of computer names attached to the network
From: beluga (beluga.13kdjj_at_mail.mcse.ms)
Date: 03/23/04
- Next message: beluga: "Re: Access denied error"
- Previous message: Tim Dawson: "Re: WMI is corrupt following SP1 installation"
- In reply to: RichB: "get list of computer names attached to the network"
- Next in thread: anonymous_at_discussions.microsoft.com: "Re: get list of computer names attached to the network"
- Reply: anonymous_at_discussions.microsoft.com: "Re: get list of computer names attached to the network"
- Messages sorted by: [ date ] [ thread ]
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
- Next message: beluga: "Re: Access denied error"
- Previous message: Tim Dawson: "Re: WMI is corrupt following SP1 installation"
- In reply to: RichB: "get list of computer names attached to the network"
- Next in thread: anonymous_at_discussions.microsoft.com: "Re: get list of computer names attached to the network"
- Reply: anonymous_at_discussions.microsoft.com: "Re: get list of computer names attached to the network"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|