Mehdi ouahabi
Mehdi ouahabi

Reputation: 67

GetFileVersionInfo() takes exactly 2 arguments (1 given)

I'm trying to create a simple script that shows file information, but I'm running into this message error : GetFileVersionInfo() takes exactly 2 arguments (1 given)

While the first two information work great

import os
import os.path, time
from win32api import GetFileVersionInfo

print ('last modified: %s ' % time.ctime(os.path.getmtime('c:/Windows/System32/apss.dll')))
print ("created: %s" % time.ctime(os.path.getctime('C:/Windows/System32/apss.dll')))
print ('File version : %s' % GetFileVersionInfo('apss.dll','c:/Windows/System32/apss.dll'))

Upvotes: 0

Views: 1180

Answers (1)

tsroten
tsroten

Reputation: 2764

You should use GetFileVersionInfo() like this:

GetFileVersionInfo(filename, subblock)

filename should be the full filename. In your case it is 'c:/Windows/System32/apss.dll'.

subblock should be '\\' or '\\VarFileInfo\\Translation'.

See ActiveState's Docs on GetFileVersionInfo() for more information.

Upvotes: 0

Related Questions