Languages :: ASP :: VBS :: Browse the computer name on LAN |
|||
| By: VB guy |
Date: 25/02/2003 00:00:00 |
Points: 50 | Status: Answered Quality : Excellent |
|
I'm looking for VB Script code to browse the network neighborhood and return the All of computer name online on the Local Area Network. |
|||
| By: VGR | Date: 25/02/2003 20:35:00 | Type : Answer |
|
| use WinNet API |
|||
| By: adersoft | Date: 25/02/2003 21:13:00 | Type : Comment |
|
| Try this simple code: Have you tried VbsEdit to edit .vbs files ? You can downlaod it from <A HREF="http://www.adersoft.com/vbsedit">http://www.adersoft.com/vbsedit</a> Dim WshShell Set WshShell = CreateObject("wscript.shell") WshShell.Run "cmd /c net view > c:\neighborhood.txt",1,True Dim fso Set fso = CreateObject("scripting.filesystemobject") Dim file Set file = fso.OpenTextFile("c:\neighborhood.txt",1) Do While Not(file.AtEndOfStream) Dim computername computername = file.ReadLine If Left(computername,2)="\\" Then Dim pos pos = InStr(computername," ") wscript.Echo Left(computername,pos-1) End If Loop file.Close |
|||
| By: VGR | Date: 25/02/2003 21:23:00 | Type : Comment |
|
| do you mean that you have a c:\neighborhood.txt file maintained by ZinDoze containing the computers in the neighborhood ?!!!?? Personally (Win2K) I don't :D |
|||
| By: adersoft | Date: 25/02/2003 21:57:00 | Type : Comment |
|
| Have a look at the third line: WshShell.Run "cmd /c net view > c:\neighborhood.txt",1,True |
|||
| By: VGR | Date: 25/02/2003 22:13:00 | Type : Comment |
|
| sorry good idea then |
|||
|
Do register to be able to answer |
|||
©2010 These pages are served without commercial sponsorship. (No popup ads, etc...). Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE.
Please DO link to this page!








