#74688 - 2003-04-23 05:41 PM
Is this possible?
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
I want to get all of the attributes from GetFileVersion for a file..
I know that you can do the following.. GetFileVersion($srcfl,'filedescription') GetFileVersion($srcfl,'fileversion') etc.
I want to get the following: filedescription fileversion internalname language originalfilename productname
I tried the following code, but know that I am wrong. Probably "can't get there from here."
code:
CLS BREAK ON DIM $i $srcfl='C:\scripts\kix32.exe' For $i = 0 to 5 $tst=GetFileVersion($srcfl,[$i]) ?$tst NEXT get K$
Thanks,
Kent
|
|
Top
|
|
|
|
#74691 - 2003-04-23 05:48 PM
Re: Is this possible?
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
I guess I could do that. I was just playing around to see if I could put this into an array..
Kent
|
|
Top
|
|
|
|
#74692 - 2003-04-23 06:17 PM
Re: Is this possible?
|
Sealeopard
KiX Master
   
Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
|
Would this work for you?code:
function ArrayGetFileVersion($sFile) dim $a[12], $b[12], $c $a='Comments','CompanyName','FileDescription','FileVersion','InternalName', 'Language','LegalCopyright','LegalTrademarks','OriginalFilename','PrivateBuild', 'ProductName','ProductVersion','SpecialBuild' if exist($sFile) for $c=0 to ubound($a) $b[$c]=getfileversion($sFile,$a[$c]) next $c else exit 2 endif $ArrayGetFileVersion=$b endfunction
[ 23. April 2003, 18:20: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.
|
|
Top
|
|
|
|
#74694 - 2003-04-23 06:20 PM
Re: Is this possible?
|
Les
KiX Master
   
Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
|
OK, I get it... you want to pass the second parm as an array element. yes that can be done. code:
break on $Array='Comments', 'CompanyName', 'FileDescription', 'FileVersion', 'InternalName', 'Language', 'LegalCopyright', 'LegalTrademarks', 'OriginalFilename', 'PrivateBuild', 'ProductName', 'ProductVersion', 'SpecialBuild' $srcfl='C:\KiX4.21rc2\kxrpc.exe' for $i = 0 to 12 $tst=GetFileVersion($srcfl,$Array[$i]) $Array[$i]+' = '+$tst ? next get $_
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.
|
|
Top
|
|
|
|
#74697 - 2003-04-23 06:31 PM
Re: Is this possible?
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Thanks guys for your help..
Kent
|
|
Top
|
|
|
|
#74700 - 2003-04-28 02:50 AM
Re: Is this possible?
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
OK..
Kind or curious why I am seeing the following:
quote:
KiXtart 2001 CareWare Ruud van Velsen (Microsoft) KiXtart main executable 4, 21, 0, 0 KIX32 0409English Copyright Ruud van Velsen 2003
KIX32.EXE 4.21 Release Candidate 2 KiXtart 4, 21, 0, 0 Build 133 ERROR : Error in expression: this type of array not supported in expressions.! Script: C:\Documents and Settings\Kent\!KIX\fileverarray.KIX Line : 43
As you can see, we get results back..
code:
ArrayGetFileVersion("C:\Documents and Settings\Kent\KiX2001.421rc2\KIX32.EXE") ; ;KIXTART BBS http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=12&t=000393 ; function ArrayGetFileVersion($sFile) dim $a[12], $b[12], $c $a='Comments','CompanyName','FileDescription','FileVersion','InternalName', 'Language','LegalCopyright','LegalTrademarks','OriginalFilename','PrivateBuild', 'ProductName','ProductVersion','SpecialBuild' if exist($sFile) for $c=0 to ubound($a) $b[$c]=getfileversion($sFile,$a[$c]) ?$b[$c] next else exit 2 endif $ArrayGetFileVersion=$b endfunction
Line 43 is -
$ArrayGetFileVersion=$b
Thanks,
Kent
|
|
Top
|
|
|
|
#74701 - 2003-04-28 03:33 AM
Re: Is this possible?
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Kent the problem is not with the line ($ArrayGetFileVersion=$b) but rather with the call to the function. You may not setting the value of the function to a variable or in a "For Each" loop.
This error occurs when KiXtart attempts to display the array to the screen. [ 28. April 2003, 03:39: Message edited by: Howard Bullock ]
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 1003 anonymous users online.
|
|
|