Windows Explorer - filter out files on a column

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Wigi
Posts: 140
Joined: 05 Jun 2017, 10:52
Contact:

Windows Explorer - filter out files on a column

24 Dec 2018, 21:34

Hello all,

I would like to automate filtering on a column in Windows Explorer. Specifically, I want to select .XLSX file types.

Has this been done before ? I found this topic and very nice code by Jeeswg:
https://autohotkey.com/boards/viewtopic.php?f=6&t=33129
I used the sorting capability here :thumbup:

But AFAIK I did not find the option to filter out files on a column.

Many thanks,

Wim
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Windows Explorer - filter out files on a column

25 Dec 2018, 05:02

I haven't tried anything with filtering, but here's some code to select/deselect files. Cheers.

Code: Select all

q:: ;explorer - select xlsx files, deselect other files
WinGet, hWnd, ID, A
oWin := ""
for oWin2 in ComObjCreate("Shell.Application").Windows
	if (oWin2.HWND = hWnd)
	{
		oWin := oWin2
		break
	}
oWin2 := ""
if !oWin
	return

for oItem in oWin.Document.Folder.Items
{
	vPath := oItem.path
	SplitPath, vPath, vName, vDir, vExt, vNameNoExt, vDrive
	;SVSI_SELECT := 0x1 ;SVSI_DESELECT := 0x0
	if (vExt = "xlsx")
	;|| (vExt = "txt")
		oWin.Document.SelectItem(oItem, 0x1)
	else
		oWin.Document.SelectItem(oItem, 0x0)
}
oWin := oItem := ""
return
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Wigi
Posts: 140
Joined: 05 Jun 2017, 10:52
Contact:

Re: Windows Explorer - filter out files on a column

25 Dec 2018, 08:43

Many thanks. This will work.

I was hoping to let AHK use the column header in Windows Explorer, like we can do it manually, and filter there. This will also hide the files we don't want.
This functionality exists in a couple of Windows versions but not that long.
Did someone do this before please ? If not I will use jeeswg's solution.
Wigi
Posts: 140
Joined: 05 Jun 2017, 10:52
Contact:

Re: Windows Explorer - filter out files on a column

27 Sep 2021, 16:44

Hi all,

Just asking if there have been improvements in this area. Did anyone manage to filter or sort in File Explorer using the column headers (like you would do it manually) ? The idea is that I use certain folders quite often and I only need the files with 1 particular extension. Other files should not be visible.

Thanks !

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: ReyAHK, Spawnova and 287 guests