473,327 Members | 1,920 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

win32 file attributes

Using the windows explorer it is possible to get file properties which
include under the version tab, 'company name', 'version', etc. I'm
assuming these metadata are actually stored in the exe somewhere. Is
there an api exposed to python that would allow me to get this info?

a scan of Mark Hammonds win32all package did have anything obvious
jump out at me...

--
David Bear
phone: 480-965-8257
fax: 480-965-9189
College of Public Programs/ASU
Wilson Hall 232
Tempe, AZ 85287-0803
"Beware the IP portfolio, everyone will be suspect of trespassing"
Jul 18 '05 #1
2 6299
The corresponding api call would be GetFileVersionInfo.
As far as I know, nobody has wrapped it for Python yet,
probably because it looks to be fairly painful.
Roger

"David Bear" <da********@asu.edu> wrote in message
news:m3************@moroni.pp.asu.edu...
Using the windows explorer it is possible to get file properties which
include under the version tab, 'company name', 'version', etc. I'm
assuming these metadata are actually stored in the exe somewhere. Is
there an api exposed to python that would allow me to get this info?

a scan of Mark Hammonds win32all package did have anything obvious
jump out at me...

--
David Bear
phone: 480-965-8257
fax: 480-965-9189
College of Public Programs/ASU
Wilson Hall 232
Tempe, AZ 85287-0803
"Beware the IP portfolio, everyone will be suspect of trespassing"

Jul 18 '05 #2
David Bear <da********@asu.edu> wrote in message news:<m3************@moroni.pp.asu.edu>...
Using the windows explorer it is possible to get file properties which
include under the version tab, 'company name', 'version', etc. I'm
assuming these metadata are actually stored in the exe somewhere. Is
there an api exposed to python that would allow me to get this info?

a scan of Mark Hammonds win32all package did have anything obvious
jump out at me...


This isn't the first time this query has come up. Use Google to search
c.l.py for GetFileVersionInfo and see if any of those links helps you
out. I seem to remember seeing someone's Python wrapper for this
really recently, but for the life of me I can't put my finger on it
now. FWIW, here's my twopence-ha'penny worth:

1) Get wmi (http://tgolden.sc.sabren.com/python/wmi.html)
2) Try this:

<code>

import os
from glob import glob

import wmi

c = wmi.WMI ()
for exe in glob ("c:\\winnt\\*.exe"):
for f in c.CIM_DataFile (Name=exe):
print os.path.basename (f.Name), "is at version", f.Version

</code>

TJG
Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: Dave | last post by:
Hi, I have done some research, trying to Clear The Screen in java code. The first option was the obv: system.out.print("\n\n\n\n\n\n\n\n\n\n\n\n"); then i heard about this method:...
0
by: gcash | last post by:
I'm having problems with some attributes in Internet Explorer. I'm trying to figure out how to set things up so I don't have to do my own event loop even though I'm using DispatchWithEvents() ...
8
by: Gerson Kurz | last post by:
Hi all, a quick question: how can I force file() to create files that have "ALL ACCESS FOR EVERYONE" security attributes? Other than by a major rewrite of my existing code modules replacing the...
7
by: John R. | last post by:
How do you set the following file attributes: Compressed Encrypted Normal ReparsePoint SparsePoint You CAN'T set these using FileInfo.Attributes or File.SetAttributes. It doesn't work for...
7
by: Mark | last post by:
Hello, I have researched and tried every thing I have found on the web, in groups and MS KB articles. Here is what I have. I have a Windows 2000 Domain Controller all service packs and...
1
by: Christian Rühl | last post by:
hey! what i wanna do sounds very simple at first, but it turned out to be a real bone crusher... i want to check if a treeView node is checked and if a correspondent node in my xml config file...
1
by: Christian Rühl | last post by:
hey! what i wanna do sounds very simple at first, but it turned out to be a real bone crusher... i want to check if a treeView node is checked and if a correspondent node in my xml config file...
0
by: =?Utf-8?B?Q29saXZpZXI=?= | last post by:
If anyone can help me with this I would really appreciate it: I have an assembly into which I have linked a manifest file as a Win32 resource. This is necessary since I want to use a class in this...
6
by: | last post by:
Hi, I'm steel trying to read and update my XML file with Visual Basic Express but i am unable to find the right way to read my xml file and update it if neccessary... Here is my problem :...
0
by: olegprog | last post by:
Dear All, I am trying to write a C# DLL that would work with VBA (in VBA I can directly call C# dll) and relatively old Win32 application (ArcView3.x). For Win32 application I would like to use C++...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.