File-Find with Dirs excluded

English support forum

Moderators: white, Hacker, petermad, Stefan2

georgeb
Senior Member
Senior Member
Posts: 250
Joined: 2021-04-30, 13:25 UTC

Re: File-Find with Dirs excluded

Post by *georgeb »

Horst.Epp wrote: 2022-08-02, 19:52 UTC What is your problem with that feature ?
You can toogle the ignore list with a button
and it is of course a normal function of a file manager to hide some files or dirs.
No problem at all - other than I'm probably never gonna use it and that it won't solve my search-problem as I'm afraid. Will test it tomorrow.
User avatar
white
Power Member
Power Member
Posts: 4594
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: File-Find with Dirs excluded

Post by *white »

Moderator message from: white » 2022-08-03, 08:23 UTC

Cleaned up deleted posts by georgeb and question about it by petermad.
georgeb
Senior Member
Senior Member
Posts: 250
Joined: 2021-04-30, 13:25 UTC

Re: File-Find with Dirs excluded

Post by *georgeb »

Thank you @JOUBE and @Horst.Epp for your advice.

I've tried that "ignore list"-feature out - and it does the trick for the search-mask as well. Although it also will hide the excluded Dirs in the file-panels as well as I already had suspected. So for me this is at least a viable workaround - if still not perfect.

As for achieving the desired goal I'm flexible though. So my request to our wizard Christian would still be to implement some
"path_exclude"-feature within the TC-plugin-section OR alternatively
generate a second/parallel "search-ignore"-list that would only (temporarily during search) affect the search-mask/-algorithm and not the main file-panels at the same time. Also it would be nice to add a small toggle-button directly within the search mask to in-/activate that exclusion list thereby eliminating the need for messing around with the general configuration each time or creating global buttons. I'm sure Christian would know best which method would be more effective and maybe easier to implement as well.

@Horst.Epp

For now and to make the current workaround more viable I've created a button to toggle this ignore-list on and off again so I can only activate the ignore-list for the intended search.

The disadvantage of this method being that if I forget to inactivate the ignore-list after the search has ended those ignored Dirs from the list will not appear in the main file-panels as well for maybe weeks to come until I might take notice of the lapse.

Question: is it possible to create such a toggle-button in a way that it would always start in off-mode (as default) whenever TC is (re-)started or the whole PC would undergo a re-boot so the toggled function could only temporarily be activated within the current instance of TC running?
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: File-Find with Dirs excluded

Post by *Horst.Epp »

georgeb wrote: 2022-08-03, 12:41 UTC ...
Question: is it possible to create such a toggle-button in a way that it would always start in off-mode (as default) whenever TC is (re-)started or the whole PC would undergo a re-boot so the toggled function could only temporarily be activated within the current instance of TC running?
Yes, but it needs some scripting.
Its based on the TC plugin Autorun.
On TC startup it starts an Autohotkey script to see if the current Ignore list state is on or off.
If its found on, a toogle is executed to set it off and the state is remembered in the ini-file.

The button which toogles the ignore list invokes an em_command
which does the toggle but also updates the state in the ini-file of the script.

In the past I did a similar thing with the function to only show files and no dirs.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
JOUBE
Power Member
Power Member
Posts: 1448
Joined: 2004-07-08, 08:58 UTC

Re: File-Find with Dirs excluded

Post by *JOUBE »

Horst.Epp wrote: 2022-08-02, 19:52 UTCYou can toogle the ignore list with a button

Code: Select all

cm_SwitchIgnoreList
JOUBE
georgeb
Senior Member
Senior Member
Posts: 250
Joined: 2021-04-30, 13:25 UTC

Re: File-Find with Dirs excluded

Post by *georgeb »

Horst.Epp wrote: 2022-08-03, 13:08 UTC The button which toogles the ignore list invokes an em_command
which does the toggle but also updates the state in the ini-file of the script.
em_command vs. cm_SwitchIgnoreList...? What's the difference?
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: File-Find with Dirs excluded

Post by *Horst.Epp »

georgeb wrote: 2022-08-03, 13:56 UTC
Horst.Epp wrote: 2022-08-03, 13:08 UTC The button which toogles the ignore list invokes an em_command
which does the toggle but also updates the state in the ini-file of the script.
em_command vs. cm_SwitchIgnoreList...? What's the difference?
An em_command is needed to start the AHK script
and also invokes the cm_command to toogle the ignore list.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
User avatar
Stefan2
Power Member
Power Member
Posts: 4133
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: File-Find with Dirs excluded

Post by *Stefan2 »

georgeb wrote: 2022-08-03, 13:56 UTC em_command vs. cm_SwitchIgnoreList...? What's the difference?

CM_ are TCs' internal default commands, see the text file TOTALCMD.INC
EM_ commands are user defined commands, mostly in usercmd.ini (more in my sig)




 
georgeb
Senior Member
Senior Member
Posts: 250
Joined: 2021-04-30, 13:25 UTC

Re: File-Find with Dirs excluded

Post by *georgeb »

Ok, meanwhile I've got the autorun-plugin v.2.1.1 properly installed ans co-started with TC by that color-definition-method. I've also created an usercmd.ini (so far empty). And if I got that right I've now got to associate some em_SetToggleIgnore-user-command with an AutoHotkey-script.

Having looked into some tutorials for AHK they all seem to show/propose defining some hotkey in the first place (as the name AHK would already suggest) and then attribute some action to it. However for my purpose of retrieving the "IgnoreListFileEnabled=x"-value within wincmd.ini - and then injecting a value of "0" to it upon TC-startup - it wouldn't appear helpful seeking to generate any hotkey at all.

So I'm afraid further coaching is needed on how to just retrieve that value from out of wincmd.ini and then changing it to "0" by some editing-process. In fact I wouldn't even need to inquire or compare that value at present state as long as I could manage to just injecting a value of "0" to it.

But how can that be done/scripted in AHK without creating any unnecessary hotkey in the first place?
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: File-Find with Dirs excluded

Post by *Hacker »

georgeb,
The disadvantage of this method being that if I forget to inactivate the ignore-list after the search has ended those ignored Dirs from the list will not appear in the main file-panels as well for maybe weeks to come until I might take notice of the lapse.
If you create a button for cm_SwitchIgnoreList, you can see if it is enabled or disabled - wouldn't that be enough?

If not, you can use a simple AHK (1.x) script such as this (untested) to run TC:

Code: Select all

IniWrite, 0, C:\Program Files\Totalcmd\wincmd.ini, Configuration, IgnoreListFileEnabled
Run, C:\Program Files\Totalcmd\TOTALCMD64.exe
HTH
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
georgeb
Senior Member
Senior Member
Posts: 250
Joined: 2021-04-30, 13:25 UTC

Re: File-Find with Dirs excluded

Post by *georgeb »

Hacker wrote: 2022-08-05, 13:08 UTC If you create a button for cm_SwitchIgnoreList, you can see if it is enabled or disabled - wouldn't that be enough?
Thanks a lot for that quick and very helpful answer. Well, with those mandatory Windows-colors in TC - pressed buttons IMHO aren't highlighted distinctly enough and I'm not in a habit of carefully monitoring the button-bar either. So I would prefer to make things "foolproof". :mrgreen:
Hacker wrote: 2022-08-05, 13:08 UTC If not, you can use a simple AHK (1.x) script such as this (untested) to run TC:
IniWrite, 0, C:\Program Files\Totalcmd\wincmd.ini, Configuration, IgnoreListFileEnabled
Bummer! That is the line I've been looking for unsuccessfully so far! Only thing is I then would NOT want to start TC via any hotkey. It starts as admin automatically on re-boot or by a task-bar-button I've created for that purpose.

Now this is where I think that "autorun"-plugin comes into play. I would create an "em_SetIgnoreList"-command in usercmd.ini.
And the only thing I'm still missing (as the documentation of autorun is only sparsely "adorned" with examples) is the correct syntax of how to call AHK from in there to execute your line given above previously stored as an AHK-script/command and without the (manual) use of an actual hotkey but rather by a direct call from that em-user-command.
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: File-Find with Dirs excluded

Post by *Hacker »

georgeb,
Only thing is I then would NOT want to start TC via any hotkey.
Just save the script as e.g. RunTC.ahk and run the script - i.e. click on it and press Enter, or double click on it. It will adjust the .ini file and run TC. You can also create a shortcut to the script on the Desktop if you'd like. I am not sure you need the autorun plugin for anything.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
georgeb
Senior Member
Senior Member
Posts: 250
Joined: 2021-04-30, 13:25 UTC

Re: File-Find with Dirs excluded

Post by *georgeb »

Hacker wrote: 2022-08-05, 15:05 UTCJust save the script as e.g. RunTC.ahk and run the script - i.e. click on it and press Enter, or double click on it. It will adjust the .ini file and run TC. ... I am not sure you need the autorun plugin for anything.
Thanks again. And you're probably "damn right"! That way autorun doesn't seem to be necessary at all.

But then perhaps the only advantage would be that with autorun I wouldn't have to change the way of calling TC at all. That way the AHK-script would sort-of become associated with the TC-namecall.

Btw., is there a direct way to start TC via AHK-script as admin/with elevated privileges without UAC-interference or manually having to acknowledge admin-privileges first?
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: File-Find with Dirs excluded

Post by *Hacker »

georgeb,
is there a direct way to start TC via AHK-script as admin/with elevated privileges without UAC-interference or manually having to acknowledge admin-privileges first?
Not a straightforward one. You can run a script as admin as described here - RunAsTask() - Auto-elevates script without UAC prompt, you'll have to confirm a UAC prompt once, and every subsequent run of the script should then run as admin automatically. Alternatively, you can perform a similar procedure for TC itself as described here - Create Elevated Shortcut to run Program: Bypass UAC Prompt, which would mean you run the script as a normal user but TC will be run as admin.

Personally, I use Winaero Tweaker and its "elevated shortcuts", which is exactly the process used in both cases above, but has a simple GUI and the result is a shortcut which runs a given program elevated.

HTH
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
georgeb
Senior Member
Senior Member
Posts: 250
Joined: 2021-04-30, 13:25 UTC

Re: File-Find with Dirs excluded

Post by *georgeb »

Hacker wrote: 2022-08-05, 16:29 UTCPersonally, I use Winaero Tweaker and its "elevated shortcuts", which is exactly the process used in both cases above, but has a simple GUI and the result is a shortcut which runs a given program elevated.
Ok, interesting. :) I'm using WinaeroTweaker as well but mainly for other purposes like declaring different and better readable fonts. Never stumbled upon this one though but will certainly look at it now that I know.

My personal and current solution for starting programs like TC as admin without triggering any UAC-prompt:
I've created a task in task-scheduler that would start TC64 "with highest privileges". To trigger this task manually (other than automatically at logon of any user) I've created a taskbar-shortcut that uses the utility "system32\schtasks" to execute that same task on demand and manually. Pretty much SOB-stuff I think.
Post Reply