Jump to content

[solved] Open this folder with only txt or only exe files


Recommended Posts

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 by Borje
Link to comment
Share on other sites

  • Moderators

Borje,

My ChooseFileFolder UDF will allow you to do that - but obviously not display them in Explorer. The link is in my sig.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators
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

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

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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)

userbar.png

Link to comment
Share on other sites

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)

userbar.png

Link to comment
Share on other sites

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 by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
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

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 by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
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

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 by KaFu
Link to comment
Share on other sites

  • Borje changed the title to [solved] Open this folder with only txt or only exe files

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...