Borje Posted July 5, 2023 Share Posted July 5, 2023 (edited) I wonder if it is possible to open this folder and only show txt or exe files, thanks for help. Perhaps any one have some example. $sfolderpath = @DesktopDir & "\konverterad\" Local $oShell = ObjCreate('shell.application') If @error Then Return SetError(1, 0, 0) EndIf $oShell.Open($sFolderPath) Return 1 Edited July 12, 2023 by Borje Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 5, 2023 Moderators Share Posted July 5, 2023 Borje, My ChooseFileFolder UDF will allow you to do that - but obviously not display them in Explorer. The link is in my sig. 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...
Borje Posted July 5, 2023 Author Share Posted July 5, 2023 Ok but I want display in explorer I have also test shellexecute it open folder in explorer and all files there is listed can nat filter to .txt or exe. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted July 5, 2023 Moderators Share Posted July 5, 2023 34 minutes ago, Borje said: Ok but I want display in explorer Can you maybe expand on what the end goal is? You can return an array of the txt and exe files in a directory, and use _ArrayDisplay, or build your own "explorer" GUI. Just curious what you are doing with the files once you list them, as there may be a better way to accomplish what you are after. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Borje Posted July 5, 2023 Author Share Posted July 5, 2023 I was just wondering if there was any way to filter without using fileopen, but one possibility is to make a own explorer window with a filter function, but I'm not sure how to do that. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 5, 2023 Moderators Share Posted July 5, 2023 Borje, Quote one possibility is to make a own explorer window with a filter function That is basically what my UDF does - you get the files displayed in a nice treeview within a GUI. Have you looked at it? 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...
KaFu Posted July 6, 2023 Share Posted July 6, 2023 This might be a good starting point. There's an example to "Automate a file search with UI Automation code", take a look at that. 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) Link to comment Share on other sites More sharing options...
KaFu Posted July 6, 2023 Share Posted July 6, 2023 Hmm, couldn't get the example to work, maybe kindly ask @LarsJ for an update of the example? 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) Link to comment Share on other sites More sharing options...
TheSaint Posted July 6, 2023 Share Posted July 6, 2023 My understanding, is that the OP wants to limit what they see in Explorer, via some kind of filter that works in Explorer. Sort of like what happens with System or Hidden files, but for all file types other than EXE or TXT. Basically some kind of Windows Explorer addon or Registry setting, that I have never heard of, and may not exist. Make sure brain is in gear before opening mouth! Remember, what is not said, can be just as important as what is said. Spoiler What is the Secret Key? Life is like a Donut If I put effort into communication, I expect you to read properly & fully, or just not comment. Ignoring those who try to divert conversation with irrelevancies. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage) Link to comment Share on other sites More sharing options...
KaFu Posted July 6, 2023 Share Posted July 6, 2023 My initial thought was to open Explorer and perform a search on "*.txt OR *.exe" through "Automating File/Windows Explorer and Desktop". 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) Link to comment Share on other sites More sharing options...
TheSaint Posted July 6, 2023 Share Posted July 6, 2023 Yeah it would be a bit like the results in a search window, only not a search window I guess, but a normal Explorer window, and of course for two file types not just one.. Make sure brain is in gear before opening mouth! Remember, what is not said, can be just as important as what is said. Spoiler What is the Secret Key? Life is like a Donut If I put effort into communication, I expect you to read properly & fully, or just not comment. Ignoring those who try to divert conversation with irrelevancies. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage) Link to comment Share on other sites More sharing options...
bogQ Posted July 7, 2023 Share Posted July 7, 2023 (edited) On 7/6/2023 at 2:32 PM, KaFu said: Hmm, couldn't get the example to work, maybe kindly ask @LarsJ for an update of the example? @KaFu depending on where your stuck "couldn't get the example to work" below is how to run example mostly Quote #include "Includes\FileExplorer.au3" #include "Includes\CUIAutomation2.au3" #include <WinAPIShellEx.au3> #include <Array.au3> Presuming you already have FileExplorer.au3 from his original post. Youl need https://github.com/jvanegmond/au3_uiautomation/blob/master/CUIAutomation2.au3 Only additional thing needed to run that example is changing variable name from $UIA_ValuePatternId to $UIA_ValuePattern if im not wrong, and it shud start i hope. EDIT!: one explorer window need to be already opened by clicking to any folder before running script!!! Edited July 7, 2023 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
KaFu Posted July 7, 2023 Share Posted July 7, 2023 It works all fine, all returns are ptrs or OK, but this call does not set a search value for me. $oEditValue.SetValue("com") 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) Link to comment Share on other sites More sharing options...
bogQ Posted July 7, 2023 Share Posted July 7, 2023 (edited) yes yes i see, CurrentIsEnabled is True and CurrentIsReadOnly is set to False, it should work according to microsoft documentation, but still a no go. I wonder if it works on vista win7 with no problems. Edit: not OS problem, Microsoft Inspect.exe can set its value with no problem. Aldo you need to focus to display changes it is strange to me why we get focus instead of just setting the value. Edited July 7, 2023 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
KaFu Posted July 7, 2023 Share Posted July 7, 2023 (edited) Strange, the first line seems to activate the explorer and gives the search box the keyboard focus, but does not fill it. Adding these line after the SetValue and the example works as I would have expected in the first place. The zip contains the example and all include files: Example8.7z ; Set search text, com $oEditValue.SetValue("") AutoItSetOption("SendKeyDelay",0) AutoItSetOption("SendKeyDownDelay",0) Send("*.txt OR *.exe") Sleep(250) Send("{ENTER}") ; Wait a second Sleep(1000) Edited July 7, 2023 by KaFu 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) Link to comment Share on other sites More sharing options...
Borje Posted July 12, 2023 Author Share Posted July 12, 2023 Thanks all here and I use KaFu exampleand that works as exspected. 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