JSI Tip 8619. How can I use the Browstat.exe support tool to return computer names, their O/S, and network roles in my workgroup or domain?

When I run Browstat.exe, from \SUPPORT\TOOLS\SUPTOOLS.MSI on the Windows CD-ROM, on my LAN, a typical output line might contain:

\\JSI007            NT   05.02 (W,S,NT,SS,PBR,BBR,DFS)     JSIINC.COM
Where:
\\JSI007                is the computer name.

NT                      is the computer's operating system.

05.02                   is the operating system version (Windows Server 2003).

(W,S,NT,SS,PBR,BBR,DFS) are the BFLAGS, described by the following:
                               W     Workstation service
                               S     Server service
                               SQL   SQLServer
                               PDC   PrimaryDomainController
                               BDC   BackupDomainController
                               TS    TimeSource
                               AFP   AFPServer
                               NV    Novell
                               MBC   MemberServer
                               PQ    PrintServer
                               DL    DialinServer
                               XN    Xenix
                               NT    Windows NT
                               WFW   WindowsForWorkgroups
                               MFPN  MS Netware
                               SS    StandardServer
                               PBR   PotentialBrowser
                               BBR   BackupBrowser
                               MBR   MasterBrowser 
                               OSF   OSFServer
                               VMS   VMSServer
                               W95   Windows95
                               DFS   DistributedFileSystem
                               CLUS  NTCluster
                               DCE   IBM DSS

JSIINC.COM              is the srvcomment data value
NOTE: In a single segment LAN, you can run Browstat.exe on any computer. If your LAN has multiple segments, run it on the master browser.

I have scripted BrowInfo.bat to return the computer name, O/S, Version, BFLAGS (without the open and close parenthesis), and srvcomment.

The syntax for using BrowInfo.bat is:

for /f "Tokens=1-4*" %%a in ('BrowInfo.bat') do (
 set computer=%%a
 set OSN=%%b
 set OSV=%%c
 set BFLAGS=%%d
 set srvcmt=%%e
 call :DoSomething
)
NOTE: BrowInfo.bat converts any " marks in srvcomment to ' and encloses the entire string in " marks. The ( and ) are removed from BFLAGS.

BrowInfo.bat contains:

@echo off
setlocal ENABLEDELAYEDEXPANSION
for /f "Tokens=2" %%a in ('browstat VIEW Transport^|find "\Device\"') do (
 for /f "Tokens=1-4*" %%b in ('browstat VIEW %%a^|findstr /L /B "\\"') do (
  set CMT=%%f
  if not \{%%f\}==\{\} set CMT=!CMT:"='!
  set FLG=%%e
  set FLG=!FLG:(=!
  set FLG=!FLG:^)=!
  @echo %%b %%c %%d !FLG! "!CMT!"
 )
)
endlocal



Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish