Thanks for Welcome
Ok here it goes:
code:
BREAK ON
flushkb
cls
$RC=0
$line=""
$logfile=""
$runfile=""
$inifile=""
$Logfile="LOG.TXT"
$Errorfile="Error.txt"
$Errorfile2="Error2.txt"
$RechnerFile="Rechner.ini"
$LogFileEng="\\" + $Rechner + "\c$\winnt\config\Wks40e.txt"
Open( 3 , $Logfile , 5 )
IF EXIST ($Errorfile)
$inifile = $Errorfile
Open( 4 , $Errorfile2 , 5 )
else
$inifile=$RechnerFile
Open( 4 , $Errorfile , 5 )
ENDIF
if open(1,$inifile) = 0
flushkb
$line = readline(1)
WHILE @error = 0
$Rechner = substr ($line,1,8)
$debug_mode = "no"
$obj = GetObject("WinNT://" + $Rechner + ",computer")
? "Bin jetzt bei Rechner: " + $Rechner
IF @error <> 0
$x = WriteLine( 4 , $Rechner + ";" + @serror + ";" + @DATE + " " + @TIME + @CRLF )
ELSE
$ikey="\\" + $Rechner + "\HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall"
$ikey3="\\" + $Rechner + "\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion"
IF (existkey($ikey) = 0)
$completed="no"
$index=0
DO
$icode=ENUMKEY($ikey, $index)
IF (@error = 0)
IF ($debug_mode = "yes")
? $ikey+"\"+$icode
ENDIF
IF (len($icode) <> 0)
$ikey1=$ikey+"\"+$icode
IF (existkey($ikey1) = 0)
$completed1="no"
$index1=0
DO
$icode1=ENUMVALUE($ikey1, $index1)
IF (@error = 0)
IF ($debug_mode = "yes")
? $icode1
ENDIF
IF ($icode1) = "DisplayName"
$Rows1=0
$Rows2=0
$Rows3=0
$Rows4=0
$Rows5=0
$Rows6=0
$Rows7=0
$Rows8=0
$Rows1 = ReadValue($ikey1, "DisplayName")
$Rows2 = ReadValue($ikey1, "DisplayVersion")
$Rows3 = ReadValue($ikey3, "ProductName")
$Rows4 = ReadValue($ikey3, "CurrentVersion")
$Rows5 = ReadValue($ikey3, "CurrentBuildNumber")
$Rows8 = ReadValue($ikey3, "CSDVersion")
if $Rows4 = "4.0"
$Rows3 = "Windows NT"
endif
$LogFileEng="\\" + $Rechner + "\c$\winnt\config\Wks40e.txt"
if EXIST ($LogFileEng)
$Rows7 = "english"
else
$Rows7 = "deutsch"
endif
;$Rows6 = $Rows3 + "/ Version: " + $Rows4 + "/ Build: " + $Rows5
$x = WriteLine( 3 , $Rechner + ";" + $Rows1 + ";" + $Rows2 + ";" + $Rows3 + ";" + $Rows4 + ";" + $Rows5 + ";" + $Rows7 + ";" + $Rows8 + ";" + @DATE + @TIME + @CRLF )
ENDIF
ELSE
$completed1="yes"
ENDIF
$index1=$index1+1
UNTIL ($completed1 = "yes")
$x=$x+")"
ENDIF
ENDIF
ELSE
$completed="yes"
ENDIF
$index=$index+1
UNTIL ($completed = "yes")
ENDIF
ENDIF
:nextline
$line = readline(1)
LOOP
$RC = close (1)
else
? "Error opening the File."
ENDIF