Can't use %PROCESSOR_ARCHITECTURE:~3,2% in TC cmd-line
Moderators: Hacker, petermad, Stefan2, white
Can't use %PROCESSOR_ARCHITECTURE:~3,2% in TC cmd-line
I need but can't use "%PROCESSOR_ARCHITECTURE:~3,2%" in TC command line.
CMD.exe works with fine with it.
For example, try Imagine.wlx plugin with it's EXE versions (both 32 and 64 bit in same dir):
"%COMMANDER_PATH%\Plugins\wlx\Imagine\Imagine%PROCESSOR_ARCHITECTURE:~3,2%.exe"
Result:
1. "x86" string gives empty line and CMD.exe lanuches Imagine.exe.
2. "amd64" gives "64" and CMD.exe lanuches Imagine64.exe.
Any ideas?
CMD.exe works with fine with it.
For example, try Imagine.wlx plugin with it's EXE versions (both 32 and 64 bit in same dir):
"%COMMANDER_PATH%\Plugins\wlx\Imagine\Imagine%PROCESSOR_ARCHITECTURE:~3,2%.exe"
Result:
1. "x86" string gives empty line and CMD.exe lanuches Imagine.exe.
2. "amd64" gives "64" and CMD.exe lanuches Imagine64.exe.
Any ideas?
2MaxX
2) Or make an imagine.cmd file whis the line:
"%COMMANDER_PATH%\Plugins\wlx\Imagine\Imagine%PROCESSOR_ARCHITECTURE:~3,2%.exe"
3) Or make a button-bar button with this content
4) Or make an internal commsnd with this code:
5) Make an alias in wincmd.ini: [Alias]img=em_imagine
You can then use imagine.cmd or em_imagine or img on the commandline.
Or you can put your own Imagine item in the main menu:
MENUITEM "Imagine Viewer", em_imagine
If you want to use the button or em_imagine command to open the file under the cursor in TC, then just add %P%N to the button or the em_imagine command - like:
If you want to use the em_imagine command or img alias to open a file added to the command line, then just add "%A" to the em_command - like:
1) Rename your imagine.exe to imaginex86.exe and rename your imagine64.exe to imagineamd64.exe and use "%COMMANDER_PATH%\Plugins\wlx\Imagine\Imagine%PROCESSOR_ARCHITECTURE%.exe"Any ideas?
2) Or make an imagine.cmd file whis the line:
"%COMMANDER_PATH%\Plugins\wlx\Imagine\Imagine%PROCESSOR_ARCHITECTURE:~3,2%.exe"
3) Or make a button-bar button with this content
Code: Select all
TOTALCMD#BAR#DATA
%COMSPEC% /C
Start "Imagine" "%%COMMANDER_PATH%%\Plugins\wlx\Imagine\Imagine%%PROCESSOR_ARCHITECTURE:~3,2%%.exe"
"%COMMANDER_PATH%\PLUGINS\wlx\Imagine\Imagine.exe"
Imagine Viewer
1
-1
Code: Select all
[em_imagine]
button="%COMMANDER_PATH%\PLUGINS\wlx\Imagine\Imagine.exe"
cmd=%COMSPEC% /C
param=Start "Imagine" "%%COMMANDER_PATH%%\Plugins\wlx\Imagine\Imagine%%PROCESSOR_ARCHITECTURE:~3,2%%.exe"
iconic=1
menu=Imagine Viewer
You can then use imagine.cmd or em_imagine or img on the commandline.
Or you can put your own Imagine item in the main menu:
MENUITEM "Imagine Viewer", em_imagine
If you want to use the button or em_imagine command to open the file under the cursor in TC, then just add %P%N to the button or the em_imagine command - like:
Code: Select all
Start "Imagine" "%%COMMANDER_PATH%%\Plugins\wlx\Imagine\Imagine%%PROCESSOR_ARCHITECTURE:~3,2%%.exe" %P%N
Code: Select all
param=Start "Imagine" "%%COMMANDER_PATH%%\Plugins\wlx\Imagine\Imagine%%PROCESSOR_ARCHITECTURE:~3,2%%.exe" "%A"
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
<side note>
Like another recent "bug" thread, this thread, too, does not qualify as a Total Command bug thread.
The reported behaviour is not caused by any misbehaviour of T.C. at all.
When you launch T.C. it is not T.C. itself that parses the commandline but Windows.
This thread should be moved to the normal English sub-forum, please.
</side note>
<confession>
Argh.
I confess not having read carefully enough the initial post.
It is about the situation where a new TC instance is launched from inside a running TC instance.
Nonetheless, we are not talking about a Total Commander 9.0beta bug here:
If you want to use environment variables in places where you can also use Total Commander internal parameter variables like %P, %T, %N, etc, you have to surround the environment variables with double ampersand %%, like petermad had already explained above.
</confession>
<Result>
The result remains the same: not a T.C. bug.
Only the first reason that I had given did not match the situation. (How embarrassing.
)
</Result>
Like another recent "bug" thread, this thread, too, does not qualify as a Total Command bug thread.
The reported behaviour is not caused by any misbehaviour of T.C. at all.
When you launch T.C. it is not T.C. itself that parses the commandline but Windows.
This thread should be moved to the normal English sub-forum, please.
</side note>
<confession>
Argh.

It is about the situation where a new TC instance is launched from inside a running TC instance.
Nonetheless, we are not talking about a Total Commander 9.0beta bug here:
If you want to use environment variables in places where you can also use Total Commander internal parameter variables like %P, %T, %N, etc, you have to surround the environment variables with double ampersand %%, like petermad had already explained above.
</confession>
<Result>
The result remains the same: not a T.C. bug.
Only the first reason that I had given did not match the situation. (How embarrassing.

</Result>
Last edited by karlchen on 2016-08-07, 21:02 UTC, edited 4 times in total.
Re: Can't use %PROCESSOR_ARCHITECTURE:~3,2% in TC cmd-line
Please don't make bug reports for problems or questions which are obviously no TC bug at all. There are enough other TC forums you can use.MaxX wrote:I need but can't use "%PROCESSOR_ARCHITECTURE:~3,2%" in TC command line.
CMD.exe works with fine with it.
For example, try Imagine.wlx plugin with it's EXE versions (both 32 and 64 bit in same dir):
"%COMMANDER_PATH%\Plugins\wlx\Imagine\Imagine%PROCESSOR_ARCHITECTURE:~3,2%.exe"
Result:
1. "x86" string gives empty line and CMD.exe lanuches Imagine.exe.
2. "amd64" gives "64" and CMD.exe lanuches Imagine64.exe.
Any ideas?
Windows 11 Home, Version 24H2 (OS Build 26100.4061)
TC 11.55 RC2 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.4 x64
TC 11.55 RC2 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.4 x64
Christian, do you plan to add ":~3,2" support?
That would be great for universal x32/x64 portable installation to use it on diffrent PCs.
That would be great for universal x32/x64 portable installation to use it on diffrent PCs.
Ukrainian Total Commander Translator. Feedback and discuss.
With Autorun plugin:MaxX wrote:for universal x32/x64 portable installation to use it on diffrent PCs.
Code: Select all
"%COMMANDER_PATH%\Plugins\wlx\Imagine\Imagine%OSARCH%.exe"
Code: Select all
LoadLibrary Plugins\Autorun_Sysinfo.dll
...
If %SYSINFO_OSARCH% = 64 Then
SetEnv OSARCH 64
Else
SetEnv OSARCH
EndIf
Code: Select all
# For SumatraPDF + Ghostscript:
SetEnv /A PATH ;%COMMANDER_PATH%\Plugins\wlx\sLister\GS
# uLister without folder %UserProgfile%\.oit:
SetEnv OIT_DATA_PATH %COMMANDER_PATH%\Plugins\wlx\uLister
# or
SetEnv OIT_DATA_PATH %COMMANDER_PATH%\Temp
# or
SetEnv OIT_DATA_PATH %Temp%
- ghisler(Author)
- Site Admin
- Posts: 50541
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
It's the first time I have heared about this feature of cmd.exe! I will add it to my wish list, but it's a very bad moment to add that now to TC9: It's already at release candidate 4, and each new feature will further delay the release...Christian, do you plan to add ":~3,2" support?
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
I second MVV's opinion. There are enough other ways, like launching some batch script which can then use the syntax specific to CMD.
Regards
Dalai
Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
That would be great for ver.10 or 9.5. Thanks.ghisler(Author) wrote:It's the first time I have heared about this feature of cmd.exe! I will add it to my wish list, but it's a very bad moment to add that now to TC9: It's already at release candidate 4, and each new feature will further delay the release...Christian, do you plan to add ":~3,2" support?