Page 1 of 1 1
Topic Options
#74688 - 2003-04-23 05:41 PM Is this possible?
Kdyer Offline
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. [Embarrassed] Probably "can't get there from here." [Razz]

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
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#74689 - 2003-04-23 05:44 PM Re: Is this possible?
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Have you tried using FSO?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#74690 - 2003-04-23 05:48 PM Re: Is this possible?
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Sorry, should have provided an example.
code:
Break on
$BasePath = "%windir%\system32\config\"
$strFile = "appevent.evt","secevent.evt","sysevent.evt"
For each $element in $strFile
$objFSO = CreateObject("Scripting.FileSystemObject")
? $BasePath + $element + " = "
$objFSO.GetFile($BasePath + $element).Size
Next
$objFSO = ""
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
#74691 - 2003-04-23 05:48 PM Re: Is this possible?
Kdyer Offline
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
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#74692 - 2003-04-23 06:17 PM Re: Is this possible?
Sealeopard Offline
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
#74693 - 2003-04-23 06:18 PM Re: Is this possible?
maciep Offline
Korg Regular
*****

Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
What's the name of the array you are trying to use?

code:
$tst=GetFileVersion($srcfl,[$i])

_________________________
Eric

Top
#74694 - 2003-04-23 06:20 PM Re: Is this possible?
Les Offline
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
#74695 - 2003-04-23 06:24 PM Re: Is this possible?
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
OH! Wanted to add that you cannot GetFileVersion() for a file that is in use.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#74696 - 2003-04-23 06:24 PM Re: Is this possible?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
UDF posted at http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=12&t=000393
_________________________
There are two types of vessels, submarines and targets.

Top
#74697 - 2003-04-23 06:31 PM Re: Is this possible?
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Thanks guys for your help..

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#74698 - 2003-04-23 06:35 PM Re: Is this possible?
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Eh guys! Try out my or Jens' scriptlet on KiX32.exe that shipped as RC2. For me it is a no go.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#74699 - 2003-04-23 06:40 PM Re: Is this possible?
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Never mind. Downloaded another copy and it is fine now.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#74700 - 2003-04-28 02:50 AM Re: Is this possible?
Kdyer Offline
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
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#74701 - 2003-04-28 03:33 AM Re: Is this possible?
Howard Bullock Offline
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 ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#74702 - 2003-04-28 06:24 AM Re: Is this possible?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
yep.
so use:
code:
$arraydata=ArrayGetFileVersion("C:\Documents and Settings\Kent\KiX2001.421rc2\KIX32.EXE")



[ 28. April 2003, 06:24: Message edited by: Lonkero ]
_________________________
!

download KiXnet

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1003 anonymous users online.
Newest Members
StuTheCoder, M_Moore, BeeEm, min_seow, Audio
17884 Registered Users

Generated in 0.068 seconds in which 0.025 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org