Here is a simple example of what could be done.

Needs lots more registry entries. If anyone that knows a useful registry location, please post it. I'm sure the IP address and NIC information is in the registry somewhere.


NOTE: I put the files in c:\kixtart because I couldn't get the SHELL 'CMD /X /C $UtilDir\srvinfo.exe -od \\$ServerName > $TempFile' line to work with a directory that had spaces. Maybe someone can fix it.


Test.kix

code:

CLS BREAK ON

$UtilDir = "C:\Kixtart"
$ServerList = "$UtilDir\ServerList.txt"
$TempFile = "$UtilDir\Temp.txt"
$OutputFile = "$UtilDir\ServerInfo.csv"

IF OPEN(1,"$ServerList")=0
$null = Open( 3 , "$OutputFile" , 5 )
$ServerName = READLINE(1)
WHILE $ServerName
? "Processing: $ServerName"
;Most of the informatio is in the same place in NT4.0 and Win2k, but not all.
$os_version = ReadValue("\\$ServerName\HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion","CurrentVersion")
IF $os_version = "5.0"
;Any Win2k Specific Reg entries (Still trying to figure this out)
ELSE
;Any NT4.0 Specific Reg Entries (Still trying to figure this
ENDIF
;Reg entries common to NT 4.0 and Win2k
$os_service_pack = ReadValue("\\$ServerName\HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion","CSDVersion")
$os_product = ReadValue("\\$ServerName\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ProductOptions","ProductType")
$Computer_Name = ReadValue("\\$ServerName\HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ComputerName\ComputerName","ComputerName")
$Host_Name = ReadValue("\\$ServerName\HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters","HostName")
$Name_Servers = ReadValue("\\$ServerName\HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters","NameServer")

SHELL 'CMD /X /C $UtilDir\srvinfo.exe -od \\$ServerName > $TempFile'
$DriveInfo = ""
$null = OPEN(2, "$TempFile")
$Drive = READLINE(2)
WHILE $Drive
$DriveInfo = $DriveInfo + "," + $Drive
$Drive = READLINE(2)
LOOP
$null = CLOSE(2)
$y = $Computer_Name + "," + $Host_Name + "," + $os_version + "," + $os_service_pack + "," + $os_product + "," + $Name_Servers + $DriveInfo + Chr(13) + Chr(10)
$x = WriteLine( 3 , "$y")

$ServerName = READLINE(1)
LOOP
$null = CLOSE(1)
$null = CLOSE(3)
ELSE
beep
? "Error, Server list not found!"
get $x
ENDIF


Input list.
ServerList.txt

code:

LTN1
LTN2
LTN3
LTN4
LTN5

Comma separtated output file.
Output.csv

code:

LTN1,ltn1,4.0,Service Pack 6,ServerNT,123.123.176.254 123.123.130.201,C$,NTFS,997,550,447,D$,NTFS,3342,1127,2215,E$,NTFS,4338,1340,2998
LTN2,ltn2,4.0,Service Pack 5,ServerNT,123.123.176.254 123.123.130.201,C$,NTFS,2001,1420,581,D$,NTFS,14332,12025,2307,E$,NTFS,8755,4572,4183
LTN3,LTN3,5.0,Service Pack 1,ServerNT,123.123.176.254 123.123.130.201,C$,NTFS,12971,2263,10708,D$,NTFS,17516,2854,14662,E$,NTFS,17516,65,17451
LTN4,LTN4,4.0,Service Pack 6,ServerNT,123.123.176.254 123.123.130.201,C$,NTFS,1091,912,179,D$,NTFS,1067,10,1057,E$,NTFS,20325,19862,463
LTN5,ltn5,4.0,Service Pack 6,ServerNT,123.123.176.254 123.123.130.201,C$,NTFS,2071,426,1645,D$,NTFS,4095,220,3875,E$,NTFS,1875,1782,93,F$,NTFS,8676,7958,718,Z$,NTFS,197,191,6

Later,
Mark P.