MCA,When i used your script it doesn't work the first time. The tempfile was created but not the final file. In debug mode i noticed that after the command if open(1,$tmpfile,2) the script makes a jump to ? "completed"
I've made some changes and now it works:
Thanks everyone how has helped me !!!
Here it is the final script:
CLS
BREAK ON
$file = "*.exe"
$startdir = "c:\windows\"
$tmpfile = "d:\log\temp.txt"
$logfile = "d:\log\files.txt"
;
? "Check "+$startdir+$file
? "Logfile "+$logfile
;
SHELL '%comspec% /c dir "$startdir$file" /s /b >$tmpfile'
;
IF Open(1,$tmpfile,2) = 0
$filename = ReadLine(1)
; ? "Line read: [" + $filename + "]"
;
WHILE @error = 0
? $filename
$companyname=GetFileVersion($filename,"CompanyName")
$fileversion=GetFileVersion($filename,"FileVersion")
$filedescription=GetFileVersion($filename,"FileDescription")
$productname=GetFileVersion($filename,"ProductName")
IF ($companyname <> "")
$logdata=$filename+Chr(9)+$filedescription+Chr(9)+$fileversion+Chr(9)+$companyname+Chr(9)+$productname+Chr(13)+Chr(10)
IF Open(2, $logfile, 5)
$nul=WriteLine(2, $logdata)
$nul=Close(2)
ENDIF
ENDIF
$filename=ReadLine(1)
LOOP
$nul=Close(1)
ENDIF
del $tmpfile
? "completed"
exit
(A bulletin board like this is not only good for you KIX knowhow but also for your English, Pfff
)
Co