File-Find with Dirs excluded

English support forum

Moderators: white, Hacker, petermad, Stefan2

User avatar
Hacker
Moderator
Moderator
Posts: 13064
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: File-Find with Dirs excluded

Post by *Hacker »

georgeb,
So it seems you are familiar with the process. What I proposed is basically exactly the same. You can run schtasks from the AHK script itself, or you can create a shortcut to schtasks and run the shortcut from AHK. Winaero Tweaker also does the same when it creates said elevated shortcuts.

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: 253
Joined: 2021-04-30, 13:25 UTC

Re: File-Find with Dirs excluded

Post by *georgeb »

Hacker wrote: 2022-08-05, 20:06 UTC You can run schtasks from the AHK script itself, or you can create a shortcut to schtasks and run the shortcut from AHK.
What I don't really get is what's the advantage of performing those steps via AHK-script? I mean the task of starting an admin-instance of TC64 without UAC at boot-up is executed by the OS itself and later on for starting a 2nd instance thereof or for simply re-opening TC after it might have been closed down a direct-link-icon in the taskbar that would call the initial task via schtasks-command by a single click on that icon will do the job after all.
User avatar
Hacker
Moderator
Moderator
Posts: 13064
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: File-Find with Dirs excluded

Post by *Hacker »

georgeb,
What I don't really get is what's the advantage of performing those steps via AHK-script?
Well, it's not only about starting TC. It's about two steps - setting the value and starting TC.
As I understood you want to disable the ignore list (i.e. set the IgnoreListFileEnabled value to 0) before running TC. My idea would be to replace the way you usually start TC with an AHK script which adjusts the .ini value and then starts TC. Of course, you can do that any way you want. You could even exit TC using a special button which would run:

Code: Select all

cm_SwitchIgnoreList -1,cm_Exit
to disable the Ignore list upon TC exit.
It's up to you whichever way is most convenient for you.

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: 253
Joined: 2021-04-30, 13:25 UTC

Re: File-Find with Dirs excluded

Post by *georgeb »

Ok, experts of the forum and for AHK - I've managed to solve the problem, well sort of.

Thanks to that crucial AHK-syntax-line provided by "Hacker" (IniWrite, 0,...) I was able to create a simple AHK-script that does the job and has been tested successfully.

I have also created an "em_SetIgnoreList"-user-command in "usercmd.ini" (and added that Dir to the path-statement) which will execute said AHK-script successfully (tested directly and by execution via some temporary button).

When it comes to automatic execution of that user-command upon TC-start the "autorun"-plugin has been suggested. I have installed v2.1.1 of that plugin properly by the described "define-colors-by-type"-procedure and "autorun.cfg" is executed demonstrably.

Now comes the tricky part. Unfortunately the documentation for the proper syntax used for "autorun.cfg" - at least as far as I've been able to find one - seems abysmal.

I've tried to invoke that user-em_command in at least a dozen of variants, regrettably all of them in vain. I've tried with and without a SendCommand-prefix (as indicated by the sample-autorun.cfg), with and without encapsulating the em_command between quotes, with and without specifying the complete path to usercmd.ini. Nothing! Zip! Nada! Apart from half a dozen of similar error-messages from the plugin upon subsequent TC-startup.

So the main question is: is there ANY near-decent documentation for the proper syntax to be used in "autorun.cfg" to be found online any place or at the minimum some more elaborate examples, at least one properly calling an em_user-command? That endless trial-and-error-approach gets a bit arduous after some time.

How I did succeed at last was by abandoning em_user-commands altogether. However I rather could launch the AHK-script directly by preceding it with a ShellExec-statement as has vaguely been indicated by the sample-cfg-file for some different purpose.

So autorun.cfg-documentation-links would be highly appreciated.
georgeb
Senior Member
Senior Member
Posts: 253
Joined: 2021-04-30, 13:25 UTC

Re: File-Find with Dirs excluded

Post by *georgeb »

Hacker wrote: 2022-08-06, 10:12 UTCAs I understood you want to disable the ignore list (i.e. set the IgnoreListFileEnabled value to 0) before running TC. My idea would be to replace the way you usually start TC with an AHK script which adjusts the .ini value and then starts TC. Of course, you can do that any way you want. You could even exit TC using a special button which would run:
Ok, that is now understood! Many thanks again for that crucial hint with the (IniWrite, 0,...)-statement, it really made my day.
As for now - as the above post shows - I've found a workaround by keeping directly starting my no-UAC-tasks and launching that crucial AHK-script-line on TC-startup via "autorun".
User avatar
Hacker
Moderator
Moderator
Posts: 13064
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: File-Find with Dirs excluded

Post by *Hacker »

georgeb,
So, instead of launching a script which sets the .ini value and launches TC, you launch TC, which launches autorun.wdx, which runs an em_command, which disables the Ignore list. Do I understand correctly? If you want to go that way, why don't you instruct autorun.wdx to execute "cm_SwitchIgnoreList -1"?

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.
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6480
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: File-Find with Dirs excluded

Post by *Horst.Epp »

Hacker wrote: 2022-08-06, 11:24 UTC georgeb,
So, instead of launching a script which sets the .ini value and launches TC, you launch TC, which launches autorun.wdx, which runs an em_command, which disables the Ignore list. Do I understand correctly? If you want to go that way, why don't you instruct autorun.wdx to execute "cm_SwitchIgnoreList -1"?

Roman
That approach would only work if the state of the Ignore list was left on.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3447)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.2 x64
User avatar
Hacker
Moderator
Moderator
Posts: 13064
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: File-Find with Dirs excluded

Post by *Hacker »

Horst.Epp,
That approach would only work if the state of the Ignore list was left on.
-1 (or 2) disables the Ignore list regardless of its previous state.

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: 253
Joined: 2021-04-30, 13:25 UTC

Re: File-Find with Dirs excluded

Post by *georgeb »

Hacker wrote: 2022-08-06, 11:24 UTCSo, instead of launching a script which sets the .ini value and launches TC, you launch TC, which launches autorun.wdx, which runs an em_command, which disables the Ignore list. Do I understand correctly? If you want to go that way, why don't you instruct autorun.wdx to execute "cm_SwitchIgnoreList -1"?
Not exactly - but quite. As I've described above I've been unable so far to launch a demonstrably working em_command via autorun.wdx for lack of the proper syntax to do so. Instead I disable the IgnoreList by directly executing your AHK-script-line via a ShellExec-command in the autorun.cfg.

As for the proposal with "cm_SwitchIgnoreList -1":
1. How is the correct syntax to declare em_user-commands (or cm_internal-commands for that matter) correctly in "autorun.cfg"? Just calling by name? Or having them preceded by a "SendCommand"-statement? Only error-msgs so far.
2. My current understanding would be that only "IgnoreListFileEnabled=" knows values/parameters (like "0" in my case) but has no associated internal command for setting them - WHEREAS "cm_SwitchIgnoreList" would be a MERE TOGGLE which doesn't accept values like "-1". Now obviously I cannot use a mandatory mere toggle on TC-startup because if "IgnoreListFileEnabled=" would already be set to "0" (my default setting active for 90% of the time) then an execution of "cm_SwitchIgnoreList" upon next TC-startup WOULD TURN THE LIST ON instead of setting it to off as needed.
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6480
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: File-Find with Dirs excluded

Post by *Horst.Epp »

Hacker wrote: 2022-08-06, 12:14 UTC Horst.Epp,
That approach would only work if the state of the Ignore list was left on.
-1 (or 2) disables the Ignore list regardless of its previous state.

Roman
You are right, cm_SwitchIgnoreList -1 works
but the help file needs an update.

From the help
IgnoreListFileEnabled=1 Determines whether the file referenced by IgnoreListFile= is enabled or not. Allows you to temporarily disable the function without removing the file's path. The internal command cm_SwitchIgnoreList toggles this option on and off.

Parameters for cm_SwitchIgnoreList are not explained and can only found by reading the History.
Thats an old problem we have, the casual user should not need to read the full history.txt
the help file has to be reference for anything.

Trying to make an em_command with cm_SwitchIgnoreList -1
doesn't work and gives the error "Function not implemented" if executed from the TC command line.
For this reason it doesn't work with the Autorun plugin.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3447)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.2 x64
georgeb
Senior Member
Senior Member
Posts: 253
Joined: 2021-04-30, 13:25 UTC

Re: File-Find with Dirs excluded

Post by *georgeb »

Hacker wrote: 2022-08-06, 12:14 UTC -1 (or 2) disables the Ignore list regardless of its previous state.
Bummer! That really works!
But now we have another problem. I've created a button in TC for toggling the IgnoreList on and off. That button uses - of course - "cm_SwitchIgnoreList".

But the input-field for any parameters (and values like -1 in this case) is greyed-out! So how am I supposed to use that "cm_SwitchIgnoreList"-internal-command in its full (undocumented) capability for a button if I cannot pass the appropriate value/parameter (like "-1" in this case) towards it??
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6480
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: File-Find with Dirs excluded

Post by *Horst.Epp »

georgeb wrote: 2022-08-06, 13:05 UTC
Hacker wrote: 2022-08-06, 12:14 UTC -1 (or 2) disables the Ignore list regardless of its previous state.
Bummer! That really works!
But now we have another problem. I've created a button in TC for toggling the IgnoreList on and off. That button uses - of course - "cm_SwitchIgnoreList".

But the input-field for any parameters (and values like -1 in this case) is greyed-out! So how am I supposed to use that "cm_SwitchIgnoreList"-internal-command in its full (undocumented) capability for a button if I cannot pass the appropriate value/parameter (like "-1" in this case) towards it??
You have to add the parameter after the cm_command
The following button works:

Code: Select all

TOTALCMD#BAR#DATA
cm_SwitchIgnoreList -1

C:\Tools\Wincmd\Icons\List.ico


0
-1
Windows 11 Home x64 Version 23H2 (OS Build 22631.3447)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.2 x64
georgeb
Senior Member
Senior Member
Posts: 253
Joined: 2021-04-30, 13:25 UTC

Re: File-Find with Dirs excluded

Post by *georgeb »

Horst.Epp wrote: 2022-08-06, 12:32 UTC For this reason it doesn't work with the Autorun plugin.
But the "autorun.cfg"-entry
SendCommand cm_SwitchIgnoreList -1
does the trick, amazingly enough!
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6480
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: File-Find with Dirs excluded

Post by *Horst.Epp »

georgeb wrote: 2022-08-06, 13:13 UTC
Horst.Epp wrote: 2022-08-06, 12:32 UTC For this reason it doesn't work with the Autorun plugin.
But the "autorun.cfg"-entry
SendCommand cm_SwitchIgnoreList -1
does the trick, amazingly enough!
Not for me, the ignore list stays on.
What is the full content of your autorun.cfg ?
Windows 11 Home x64 Version 23H2 (OS Build 22631.3447)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.2 x64
georgeb
Senior Member
Senior Member
Posts: 253
Joined: 2021-04-30, 13:25 UTC

Re: File-Find with Dirs excluded

Post by *georgeb »

Horst.Epp wrote: 2022-08-06, 13:19 UTC What is the full content of your autorun.cfg ?
Here you go:

Code: Select all

# Enables ModifyDialogs functionality
# Âêëþ÷àåò ôóíêöèîíàë ModifyDialogs
# LoadLibrary Plugins\Autorun_ModifyDialogs.dll
# ModifyDialogs

# Uncomment to enable additional system info
# Ðàñêîììåíòèðóéòå äëÿ äîïîëíèòåëüíîé ñèñòåìíîé èíôîðìàöèè
# LoadLibrary Plugins\Autorun_Sysinfo.dll

# Adding current TC path to PATH environment variable
# Äîáàâëÿåò ê ïåðåìåííîé îêðóæåíèÿ PATH òåêóùóþ ïàïêó TC
SetEnv /A /EV PATH ;%COMMANDER_PATH%

# Enables showing of administrative shares
# Âêëþ÷àåò îòîáðàæåíèå àäìèíèñòðàòèâíûõ øàð
SendCommand cm_AdministerServer

# ***********************************************************************************
# SendCommand em_SetIgnoreList **fails
# SendCommand "c:\WINTOOL\TotalCmd\SetIgnoreList.ahk" **fails
# ShellExec "c:\WINTOOL\TotalCmd\SetIgnoreList.ahk" **working
SendCommand cm_SwitchIgnoreList -1
# ***********************************************************************************

# The block below sets COMMANDER_PROGRAM environment variable
# to corresponding TC executable path depending on it's architecture
# Áëîê íèæå óñòàíàâëèâàåò â ïåðåìåííóþ îêðóæåíèÿ COMMANDER_PROGRAM
# ïóòü ê èñïîëíÿåìîìó ôàéëó TC â çàâèñèìîñòè îò åãî àðõèòåêòóðû
If %AUTORUN_TCARCH% = 32 Then 
  SetEnv /EV COMMANDER_PROGRAM %COMMANDER_PATH%\TOTALCMD.EXE
Else 
  SetEnv /EV COMMANDER_PROGRAM %COMMANDER_PATH%\TOTALCMD64.EXE
EndIf

# Retrieve OS version with commandline tool. This can be relatively slow.
# Ïîëó÷åíèå âåðñèè ÎÑ ñ ïîìîùüþ êîìàíäíîé ñòðîêè Windows. Ýòî ìîæåò áûòü îòíîñèòåëüíî ìåäëåííî.
#
# LoadLibrary Plugins\Autorun_Process.dll
# ProcessExecGetOutput OSVER %COMSPEC% '/c ver'
# SetEnv /EV COMMANDER_OSVER "%OSVER%"

# After this line all actions are performed when TC closing
# Ïîñëå ýòîé ñòðîêè âñå äåéñòâèÿ âûïîëíÿþòñÿ ïðè çàêðûòèè TC
Pragma AutorunFinalizeSection

Post Reply