Dizzy Posted January 21, 2010 Share Posted January 21, 2010 Hi to all, i've searched for information how to get all 16bit programs on my pc. But didn't found anything. Is it possible with autoit to scan all files (exe, dll, ...) on my local c:-drive and get a list, if they are 16, 32, or 64bit programs? Any help is welcome! Thanks Dizzy Link to comment Share on other sites More sharing options...
Dizzy Posted January 21, 2010 Author Share Posted January 21, 2010 One more ... ... is there any function in autoit to examine a file if it is a 16 or 32bit program? Thx Dizzy Link to comment Share on other sites More sharing options...
KaFu Posted January 21, 2010 Share Posted January 21, 2010 (edited) Interesting question ... expandcollapse popup$file = FileOpenDialog("Please select file", "", "All (*.*)"); If @error Then Exit MsgBox(0, "", "Binary Type of the file " & $file & @CRLF & @CRLF & _GetBinaryType($file) & @crlf & @crlf & "Error: " & @error) Func _GetBinaryType($file) ;http://msdn.microsoft.com/en-us/library/aa364819(VS.85).aspx If Not FileExists($file) Then Return SetError(1, 0, 0) Local $stType = DllStructCreate("dword;") $aRet = DllCall("kernel32.dll", "hwnd", "GetBinaryType", "str", $file, "ptr", DllStructGetPtr($stType)) if $aRet[0] = 0 then Return SetError(2, 0, "Not an executable file") ; not an executable file ; Local Const $SCS_32BIT_BINARY = 0 ; A 32-bit Windows-based application ; Local Const $SCS_DOS_BINARY = 1 ; An MS-DOS – based application ; Local Const $SCS_WOW_BINARY = 2 ; A 16-bit Windows-based application ; Local Const $SCS_PIF_BINARY = 3 ; A PIF file that executes an MS-DOS – based application ; Local Const $SCS_POSIX_BINARY = 4 ; A POSIX – based application ; Local Const $SCS_OS216_BINARY = 5 ; A 16-bit OS/2-based application ; Local Const $SCS_64BIT_BINARY = 6 ; A 64-bit Windows-based application Switch DllStructGetData($stType, 1) Case 0 Return "A 32-bit Windows-based application" Case 1 Return "An MS-DOS – based application" Case 2 Return "A 16-bit Windows-based application" Case 3 Return "A PIF file that executes an MS-DOS – based application" Case 4 Return "A POSIX – based application" Case 5 Return "A 16-bit OS/2-based application" Case 6 Return "A 64-bit Windows-based application" EndSwitch EndFunc ;==>_GetBinaryType Edited January 21, 2010 by KaFu OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Dizzy Posted January 21, 2010 Author Share Posted January 21, 2010 Hi KaFu, works perfect. Thanks for your example!!! Dizzy Link to comment Share on other sites More sharing options...
KaFu Posted January 21, 2010 Share Posted January 21, 2010 Gern geschehen, Herr Nachbar ... OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
rudi Posted January 21, 2010 Share Posted January 21, 2010 Gern geschehen, Herr Nachbar ...Hut ab, und: RESPEKT! Kann ich auch gleich gut gebrauchen Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
Dizzy Posted January 25, 2010 Author Share Posted January 25, 2010 Gern geschehen, Herr Nachbar ...Ha - wie klein die Welt doch ist ...Danke! Dann kann ich beim nächsten Problem ja "mal eben rumkommen"? GrußDizzy 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