KaFu Posted January 29, 2012 Posted January 29, 2012 Browsing MSDN I've found the function SaferiIsExecutableFileType. http://msdn.microsoft.com/en-us/library/windows/desktop/ms722429%28v=vs.85%29.aspx "The SaferiIsExecutableFileType function determines whether a specified file is an executable file. Applications use this function to determine whether a file is an executable file, and if it is, then the application can take security precautions to prevent invoking untrustworthy code." $b_FirstExtensionFound = False $i = 0 $iFound = 0 While 1 $i += 1 $var = RegEnumKey("HKCR", $i) If @error <> 0 Then ExitLoop If StringLeft($var, 1) = "." Then $aRes = DllCall("Advapi32.dll", "int", "SaferiIsExecutableFileType", "wstr", "test" & $var, "byte", 0) Switch $aRes[0] Case 1 ConsoleWrite("+ Executable" & @TAB & $var & @TAB & $aRes[0] & @CRLF) $iFound += 1 Case 0 ;ConsoleWrite("- Not Executable" & @TAB & $var & @TAB & $aRes[0] & @CRLF) EndSwitch $b_FirstExtensionFound = True Else If $b_FirstExtensionFound Then ExitLoop EndIf WEnd ConsoleWrite(@CRLF & $iFound & @CRLF) JScript 1 OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
JScript Posted January 31, 2012 Posted January 31, 2012 Veri nice and very useful! Thank you. Regards, João Carlos. http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere!
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