Page 1 of 1

Total Commander architecture variable

Posted: 2016-07-26, 13:19 UTC
by LonerD
It would be useful to have Total Commander architecture predefined variable.
Like %commander_arch% with values 32 or 64 depending running TC bitness.

This possibility presents in Autorun plugin, or we can get bitness in scripts. But I think it's important variable, and TC must have it natively.

Posted: 2016-07-26, 13:22 UTC
by Horst.Epp
No need for a TC variable as we already have OS environment
PROCESSOR_ARCHITECTURE=AMD64

Posted: 2016-07-26, 13:49 UTC
by LonerD
2Horst.Epp
It's OS architectute.
My suggestion about current running TC process bitness.

Posted: 2016-07-26, 14:24 UTC
by Dalai
2LonerD
PROCESSOR_ARCHITECTURE will be/contain "x86" in a 32 bit process on Windows x64.

Regards
Dalai

Posted: 2016-07-26, 14:59 UTC
by Horst.Epp
LonerD wrote:2Horst.Epp
It's OS architectute.
My suggestion about current running TC process bitness (I have fix first post).
For what do I need that info in a script or batch ?
It doesn't matter which TC version started the process
of interest is only the OS type.

Posted: 2016-07-26, 16:10 UTC
by LonerD
Horst.Epp wrote:For what do I need that info in a script or batch ?
No ideas for what you need that info.
TC has many-many options, that not used by ALL users.

But for example - I need this info for work with TC control's classes (windows, buttons, checkboxes... etc) in scripts. Classes have different names in 32 and 64 bit TC. Also this information uses for run 32x or 64x programs depending TC bitness.

Posted: 2016-07-27, 20:20 UTC
by petermad
2LonerD

Checking PROCESSOR_ARCHITECTURE from within TC or from a DOS console startet from TC will show:
PROCESSOR_ARCHITECTURE=amd64 when running TC x64
and
PROCESSOR_ARCHITECTURE=x86 wen running TC 32bit

Isn't that good enough?

Example:

Code: Select all

TOTALCMD#BAR#DATA
cd %PROCESSOR_ARCHITECTURE%

%COMMANDER_EXE%,6
CD x86 or amd64


-1
Copy this buttton to your button bar. Make a x86 and a amd64 directory - click the button and see what happens depending on which version of TC you are running.

Posted: 2016-07-29, 01:43 UTC
by LonerD
petermad wrote: Checking PROCESSOR_ARCHITECTURE from within TC or from a DOS console startet from TC
Yes. It works directly from TC.
But not from scripts (AutoIT, AHK) or another programs. For example - %commander_path% and %commander_exe% work from any program that running from TC, and it's very useful.

Posted: 2016-07-29, 08:41 UTC
by Horst.Epp
LonerD wrote:
petermad wrote: Checking PROCESSOR_ARCHITECTURE from within TC or from a DOS console startet from TC
Yes. It works directly from TC.
But not from scripts (AutoIT, AHK) or another programs. For example - %commander_path% and %commander_exe% work from any program that running from TC, and it's very useful.
Compile your scripts and they have access to all TC variables if startet from TC

Posted: 2016-07-29, 08:41 UTC
by MVV
LonerD,
Can't you set such envvar to %PROCESSOR_ARCHITECTURE% within TC using Autorun plugin?