[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
User avatar
dmocha
Junior Member
Junior Member
Posts: 52
Joined: 2013-05-05, 19:09 UTC
Location: Poland

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

Post by *dmocha »

Unfortunately, none of these options work.
regards
dmocha
User avatar
Gral
Power Member
Power Member
Posts: 1467
Joined: 2005-01-26, 15:12 UTC

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

Post by *Gral »

Prefixed by "ShellExec"!

Code: Select all

ShellExec TASKKILL.EXE /IM program.exe /T /F
Fla$her
Power Member
Power Member
Posts: 2320
Joined: 2020-01-18, 04:03 UTC

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

Post by *Fla$her »

2dmocha, Gral, don't be lazy to use the help.
Overquoting is evil! 👎
User avatar
Gral
Power Member
Power Member
Posts: 1467
Joined: 2005-01-26, 15:12 UTC

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

Post by *Gral »

Actually, I don't use Autorun plugin.
Fla$her
Power Member
Power Member
Posts: 2320
Joined: 2020-01-18, 04:03 UTC

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

Post by *Fla$her »

Gral wrote: 2023-11-06, 19:58 UTC Actually, I don't use Autorun plugin.
Do you think it makes sense to help without knowledge of the subject? ;)
P. S.: For me, this is the №1 plugin! :)
Overquoting is evil! 👎
User avatar
Gral
Power Member
Power Member
Posts: 1467
Joined: 2005-01-26, 15:12 UTC

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

Post by *Gral »

ShellExec method should works anyway, isn't it?
User avatar
dmocha
Junior Member
Junior Member
Posts: 52
Joined: 2013-05-05, 19:09 UTC
Location: Poland

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

Post by *dmocha »

Believe me, before I posted a question here on the forum for the first time, I tried to use the information about ProcessTerminate, but all attempts to create a line failed, maybe I was doing something wrong.
I did it differently and it works. I am passing this on to other interested parties, not everyone can read the help file skillfully (unfortunately it didn't help me).

Code: Select all

ShellExec /EV /SW_HIDE '%COMSPEC%' '/c taskkill /F /IM TotalMouseEX.exe'
regards
dmocha
Fla$her
Power Member
Power Member
Posts: 2320
Joined: 2020-01-18, 04:03 UTC

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

Post by *Fla$her »

Gral wrote: 2023-11-06, 20:21 UTC ShellExec method should works anyway, isn't it?
It's impractical to use a console utility, calling an extra process when it can be done by a function built into a child plugin.

dmocha wrote: 2023-11-06, 21:10 UTCmaybe I was doing something wrong.
Have you loaded the appropriate library for calling the function?

Code: Select all

LoadLibrary Plugins\Autorun_Process.dll

Pragma AutorunFinalizeSection
ProcessTerminate /A /W TotalMouseEX.exe
Overquoting is evil! 👎
User avatar
dmocha
Junior Member
Junior Member
Posts: 52
Joined: 2013-05-05, 19:09 UTC
Location: Poland

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

Post by *dmocha »

Fla$her wrote: 2023-11-07, 00:50 UTC Have you loaded the appropriate library for calling the function?

Code: Select all

LoadLibrary Plugins\Autorun_Process.dll

Pragma AutorunFinalizeSection
ProcessTerminate /A /W TotalMouseEX.exe
You're right, I didn't load the library.
I corrected the cfg file, it works as it should, thanks
regards
dmocha
Hurdet
Power Member
Power Member
Posts: 626
Joined: 2003-05-10, 18:02 UTC

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

Post by *Hurdet »

Code: Select all

MsgBox "HI" "TEST"
LoadLibrary Plugins\Autorun_Sysinfo.dll
LoadLibrary %COMMANDER_PATH%\Plugins\WFX\VirtualPanel\VirtualPanel.wfx
SetEnv /A zzzz %SYSINFO_OSVERSION%
MsgBox work
Autorun_Sysinfo.dll work
SetEnv work

VirtualPanel.wfx not work
Drag file over locked folder VirtualPanel locked not work before it is focused.
Why?
User avatar
nsp
Power Member
Power Member
Posts: 1809
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

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

Post by *nsp »

Hurdet wrote: 2024-04-28, 08:44 UTC MsgBox "HI" "TEST" LoadLibrary Plugins\Autorun_Sysinfo.dll LoadLibrary %COMMANDER_PATH%\Plugins\WFX\VirtualPanel\VirtualPanel.wfx SetEnv /A zzzz %SYSINFO_OSVERSION%
If you run 64bit TC, you have to load wfx64 version.
what you can also do is to use a command that switch to locked virtual folder to activate it and go to previous folder after...
--- Edited
This kind of autorun.cfg could work for you:

Code: Select all

CommandExec /CD:S "\\\VirtualPanel"
SendCommand cm_GoToPreviousDir
Pragma AutorunFinalizeSection
Hurdet
Power Member
Power Member
Posts: 626
Joined: 2003-05-10, 18:02 UTC

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

Post by *Hurdet »

If you run 64bit TC, you have to load wfx64 version.
For simplicity plugin using and using single config file in different TC versions, for 64-bit verions implicit loading used (similarly to TC plugins). For that 64-bit version of plugin should have «dll64» extension. In configuration «dll» extension using.

Example (on MoveButton): record in configuration «LoadLibrary Plugins\Autorun_MoveButton.dll». Under 32-bit version will be loaded Autorun_MoveButton.dll, under 64-bit version — Autorun_MoveButton.dll64.
Fla$her
Power Member
Power Member
Posts: 2320
Joined: 2020-01-18, 04:03 UTC

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

Post by *Fla$her »

Hurdet wrote: 2024-04-28, 08:44 UTC VirtualPanel.wfx not work
You've misinterpreted the reference material. LoadLibrary refers exclusively to child plugins or libraries for which the software part described on the Appendix > For developers page is implemented. No other TC plugins or libraries can be loaded in this way.
Overquoting is evil! 👎
Hurdet
Power Member
Power Member
Posts: 626
Joined: 2003-05-10, 18:02 UTC

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

Post by *Hurdet »

I suspected this thanks for the confirmation
Fla$her
Power Member
Power Member
Posts: 2320
Joined: 2020-01-18, 04:03 UTC

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

Post by *Fla$her »

2Hurdet
CommandExec /CD:S "\\\Virtual_Panel"
There is a space by default.

Code: Select all

CommandExec /CD:S '\\\Virtual Panel'
Although the wfx plugin folder can be renamed in the settings as you like.

Pragma AutorunFinalizeSection is added only to avoid accidentally inserting suggested commands after it, i.e. the directive itself is optional.
Overquoting is evil! 👎
Post Reply