dirty Posted February 5, 2010 Share Posted February 5, 2010 (edited) i looked at http://www.autoitscript.com/forum/index.php?showtopic=109450bit its for XP.Windows 7 is different so its no help.http://www.autoitscript.com/forum/index.php?showtopic=25859 does not get product version or fileversionIsnt there a simpler way to get file information just like FileGetVersion does ?Kinda like C++ http://msdn.microsoft.com/en-us/library/aa364952%28VS.85%29.aspx ?I know autoit is not C++, but if FileGetVersion is there then where is the rest ?I wonder if FileGetVersion is an au3 that can be opened and modified..........Thanks for help Edited February 5, 2010 by dirty Link to comment Share on other sites More sharing options...
james3mg Posted February 5, 2010 Share Posted February 5, 2010 It does work for Vista and 7, but the numbers are all moved around. I've had to go through and poll all the properties to find the number of the property that I want before, then use an @OSVersion switch to make sure and read the correct one. ...though someone else may know of a more reliable way "There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 5, 2010 Moderators Share Posted February 5, 2010 dirty,If you scroll down the list of property numbers that I posted in the second codebox here, you will see that there are also the codes for Vista and Win7.So for Win 7, Product version = 252 M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
dirty Posted February 5, 2010 Author Share Posted February 5, 2010 (edited) $prop = _GetExtProperty($path,252) returns 0 but thanks to you i made this. expandcollapse popup#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Res_Comment=Comment #AutoIt3Wrapper_Res_Description=Description #AutoIt3Wrapper_Res_Fileversion=1.1 #AutoIt3Wrapper_Res_LegalCopyright=Copyright #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $OSbit = @OSArch $OS = @OSVersion $Form1 = GUICreate("",200,500) $edit = GUICtrlCreateEdit ("",0,0,200,480) $button = GUICtrlCreateButton ("search",0,480,200,20) $path = FileOpenDialog("Find File", @ScriptDir & "\", "All Files (*.*)",1+2) If $path = "" Then MsgBox(48,'ERROR',"You need to open file. Exiting now...") Exit Else EndIf GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $button For $i = 1 To 500 $prop = _GetExtProperty($path,$i) ;Server 2003 If $OS = "WIN_2003" And $prop > "0" Then GUICtrlSetData ($edit, "Windows Server 2003 #" & $i & "=" & $prop & @CRLF,"Input") ElseIf $OS = "WIN_2003" And $prop = "0" Then GUICtrlSetData ($edit, "","input") ;XP ElseIf $OS = "WIN_XP" And $OSbit = "X86" And $prop > "0" Then GUICtrlSetData ($edit, "Windows XP 32bit #" & $i & "=" & $prop & @CRLF,"Input") ElseIf $OS = "WIN_XP" And $OSbit = "X86" And $prop = "0" Then GUICtrlSetData ($edit, "","input") ElseIf $OS = "WIN_XP" And $OSbit = "X64" And $prop > "0" Then GUICtrlSetData ($edit, "Windows XP 64bit #" & $i & "=" & $prop & @CRLF,"Input") ElseIf $OS = "WIN_XP" And $OSbit = "X64" And $prop = "0" Then GUICtrlSetData ($edit, "","input") ;Server 2008 ElseIf $OS = "WIN_2008" And $OSbit = "X86" And $prop > "0" Then GUICtrlSetData ($edit, "Windows Server 2008 32bit #" & $i & "=" & $prop & @CRLF,"Input") ElseIf $OS = "WIN_2008" And $OSbit = "X86" And $prop = "0" Then GUICtrlSetData ($edit, "","input") ElseIf $OS = "WIN_2008" And $OSbit = "X64" And $prop > "0" Then GUICtrlSetData ($edit, "Windows Server 2008 64bit #" & $i & "=" & $prop & @CRLF,"Input") ElseIf $OS = "WIN_2008" And $OSbit = "X64" And $prop = "0" Then GUICtrlSetData ($edit, "","input") ;Vista Windows 7 ElseIf $OS = "WIN_VISTA" And $OSbit = "X86" And $prop > "0" Then GUICtrlSetData ($edit, "Windows 7 32bit #" & $i & "=" & $prop & @CRLF,"Input") ElseIf $OS = "WIN_VISTA" And $OSbit = "X86" And $prop = "0" Then GUICtrlSetData ($edit, "","input") ElseIf $OS = "WIN_VISTA" And $OSbit = "X64" And $prop > "0" Then GUICtrlSetData ($edit, "Windows 7 64bit #" & $i & "=" & $prop & @CRLF,"Input") ElseIf $OS = "WIN_VISTA" And $OSbit = "X64" And $prop = "0" Then GUICtrlSetData ($edit, "","input") EndIf ; repeat 500 times Next MsgBox(32,'Status','DONE') EndSwitch WEnd #Region ;This is the function that should not be touched Func _GetExtProperty($sPath, $iProp) Local $iExist, $sFile, $sDir, $oShellApp, $oDir, $oFile, $aProperty, $sProperty $iExist = FileExists($sPath) If $iExist = 0 Then SetError(1) Return 0 Else $sFile = StringTrimLeft($sPath, StringInStr($sPath, "\", 0, -1)) $sDir = StringTrimRight($sPath, (StringLen($sPath) - StringInStr($sPath, "\", 0, -1))) $oShellApp = ObjCreate ("shell.application") $oDir = $oShellApp.NameSpace ($sDir) $oFile = $oDir.Parsename ($sFile) If $iProp = -1 Then Local $aProperty[35] For $i = 0 To 34 $aProperty[$i] = $oDir.GetDetailsOf ($oFile, $i) Next Return $aProperty Else $sProperty = $oDir.GetDetailsOf ($oFile, $iProp) If $sProperty = "" Then Return 0 Else Return $sProperty EndIf EndIf EndIf EndFunc ;==>_GetExtProperty #EndRegion Please someone with Windows 7 32bit or XP 64bit confirm that the following result are same. That way i would know that at least OS architecture has no effect on those numbers. ################### # Windows 7 64bit # ################### 1=Size 2=Type 3=Date Modified 4=Date Created 5=Date Accessed 6=Attributes 10=Owner 11=Kind 16=Genre 18=Tags 19=Rating 20=Authors 22=Subject 25=Copyright 27=Lenght 28=Bit Rate 31=Dimensios 34=Description 35=Program Name 53=Computer 155=Name 156=File Version 160=Bit Depth 161=dpi 162=Width 163=dpi 164=Height 175=Current Folder 176=Folder Path 179=full Path TO File 181=Item Type 184=Language 267=Product Name 268=Product Version 276=Legal Trademarks 279=Data Rate 280=Frame Height 281=FrameRate 282=Frame Width 188=URL 189=URL 283=Total BitRate #################### # Windows XP 32bit # #################### 1=Size 2=Type 3=Date Modified 4=Date Created 5=Date Accessed 6=Attributes 8=Computer or SID 10=Title 11=Subject 14=COmments 26=Dimensions 27=Width 28=Height 31=Signing Time 35=Company Name 36=Internal Name 37=File Version 38=Product Name 39=Product Version Edited February 6, 2010 by dirty Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now