[WDX] Autorun Plugin: Run commands/set envvars on TC start

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
baiyq
Junior Member
Junior Member
Posts: 6
Joined: 2010-03-15, 08:28 UTC

Post by *baiyq »

yes, It's works fine now! thanks a lot!
Orochi
Junior Member
Junior Member
Posts: 58
Joined: 2011-10-09, 21:32 UTC

Re: [WDX] Autorun Plugin: Run commands/set envvars on TC start

Post by *Orochi »

Does IniDelete command work with xml files, or is this command strictly for ini files?
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6449
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: [WDX] Autorun Plugin: Run commands/set envvars on TC start

Post by *Horst.Epp »

Orochi wrote: 2020-12-19, 14:58 UTC Does IniDelete command work with xml files, or is this command strictly for ini files?
If you look into an ini-file and an xml file you will see that it can't work.
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
Orochi
Junior Member
Junior Member
Posts: 58
Joined: 2011-10-09, 21:32 UTC

Re: [WDX] Autorun Plugin: Run commands/set envvars on TC start

Post by *Orochi »

If you look into an ini-file and an xml file you will see that it can't work.
Are you referring to section name in the ini-file?
pandaprada
Junior Member
Junior Member
Posts: 3
Joined: 2021-07-28, 03:51 UTC

[WDX] Autorun Plugin: Help needed for Pragma AutorunLoadInSubrocess

Post by *pandaprada »

I'm trying to use AutorunLoadInSubrocess, but it doesn't seem to work.

I've put Pragma AutorunLoadInSubrocess and some script in the autorun.cfg

when I starts total commander (TOTALCMD64.exe), the script starts, no problem here.

But when I start "totalcmd64.exe /S=L file.txt" (a separate process as specified for the AutorunLoadInSubrocess), the script won't start.

BTW, Is there a typo in Pragma AutorunLoadInSubrocess. Should it be Pragma AutorunLoadInSubprocess?. There is a P missing in the documentation.

Anyway, I tried Pragma AutorunLoadInSubprocess as well, it didn't work either.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Re: [WDX] Autorun Plugin: Run commands/set envvars on TC start

Post by *MVV »

Maybe TC simply doesn't load content plugins when you run TOTALCMD /S=L? You can check if Autorun.wdx is loaded into TC using e.g. Process Hacker.

There is really a typo in AutorunLoadInSubrocess pragma name, but it seems that plugin author wants to remove it anyway.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [WDX] Autorun Plugin: Run commands/set envvars on TC start

Post by *ghisler(Author) »

Maybe TC simply doesn't load content plugins when you run TOTALCMD /S=L?
Indeed it doesn't. Content plugins are only loaded in the main TC program, which is bypassed with /S=L.
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Re: [WDX] Autorun Plugin: Run commands/set envvars on TC start

Post by *MVV »

Thank you for confirming it, Christian! So am I right that TC never loads coloring content plugins in its subprocesses and special modes?

This directive is described like this:
Pragma AutorunLoadInSubrocess
By default, Autorun will not run, if TC executed as separate process for search/view/etc. But you can change this behaviour with this directive.
It seems that the original intent was to bypass execution of commands in special modes but in such case this directive seems to be useless and never-working if it is configured to load via file coloring.

In plugin discussion topic on Russan board there was an old report that plugin does unneeded actions on TOTALCMD /S=L, so it seems that older TC versions loaded content plugins in Lister mode, didn't they?

BTW I've just added a ShellExec command to Autorun.cfg for displaying a message box, and it seems that either TOTALCMD /S=L or separate search load the plugin!
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: [WDX] Autorun Plugin: Run commands/set envvars on TC start

Post by *Fla$her »

ghisler(Author) wrote: 2021-08-05, 10:09 UTCwhich is bypassed with /S=L.
And what about /O ? Why hasn't it been done for him yet? Navigating to a file or opening a directory by /O [PATH], /O /L=[PATH], /R=[PATH] takes significantly longer than cd [PATH]. The same goes for /S=C.
For cm_SearchStandalone, em_SyncStandalone, /S=F, /S=S, it would be logical to make keys/options for listing the names of only required or ignored (Autorun, TwinKey etc) plugins.
Overquoting is evil! 👎
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [WDX] Autorun Plugin: Run commands/set envvars on TC start

Post by *ghisler(Author) »

The reason why the autorun plugin isn't loaded when not loading the main Total Commander is the following:
The plugin uses a trick to get loaded: You need to define a color filter (define colors by file type) with this plugin. When a directory is displayed, TC sees that this plugin is needed for the color filter, and loads it. Since no color filters are used in synchronize dirs etc, the autorun plugin doesn't get loaded.
Author of Total Commander
https://www.ghisler.com
pandaprada
Junior Member
Junior Member
Posts: 3
Joined: 2021-07-28, 03:51 UTC

Re: [WDX] Autorun Plugin: Run commands/set envvars on TC start

Post by *pandaprada »

As suggested by *MVV, I started "totalcmd64.exe /S=L file.txt" and use the process explorer to check.

And it turns out that the autorun.wdx64 is indeed loaded.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Re: [WDX] Autorun Plugin: Run commands/set envvars on TC start

Post by *MVV »

My tests also show that plugin is loaded, in /S=L mode too, and commands are executed.

pandaprada,
Maybe there is an error in your script? Please try to ShellExec e.g. notepad.exe to see if it is started when you execute TOTALCMD /S=L. I've tried latest plugin version and Notepad is opened even for /S=L w/o mentioned pragma at all.
pandaprada
Junior Member
Junior Member
Posts: 3
Joined: 2021-07-28, 03:51 UTC

Re: [WDX] Autorun Plugin: Run commands/set envvars on TC start

Post by *pandaprada »

@ *MVV
I'm using this version "wdx_autorun_2.2.4_beta.zip" of the plugin and tried again. There is only one entry "ShellExec notepad.exe" in autorun.cfg

It's the same result as before: Totalcmd64.exe will start the notepad; but for /S=L, notepad won't be started.

I've also tried this version "wdx_autorun_2.1.1.zip" with the same result.

BTW, I'm using Total Commander x64 10.00.

Also, I made another attempt.
I did a new clean total commander setup without any other plugins except autorun and set the autorun up ( color section etc...). And put only one entry "ShellExec notepad.exe" in autorun.cfg.

The result is the same: Totalcmd64.exe alone will start the notepad; but with /S=L file.txt, notepad won't be started.
zhxeeaa
Junior Member
Junior Member
Posts: 50
Joined: 2016-12-10, 06:21 UTC

Re: [WDX] Autorun Plugin: Run commands/set envvars on TC start

Post by *zhxeeaa »

Is there any way to detect the TC window is activated then run the specified command again?
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: [WDX] Autorun Plugin: Run commands/set envvars on TC start

Post by *Fla$her »

zhxeeaa wrote: 2022-08-28, 19:17 UTCthe specified command?
Namely? What for? What goal are you pursuing?
Overquoting is evil! 👎
Post Reply