[11.57a RC1] em command not working

Bug reports will be moved here when the described bug has been fixed

Moderators: petermad, Stefan2, white, Hacker

User avatar
zhugecaomao
Junior Member
Junior Member
Posts: 89
Joined: 2022-08-23, 05:08 UTC
Contact:

[11.57a RC1] em command not working

Post by *zhugecaomao »

hi, I have encountered an issue with my Start menu commands in Total Commander 11.57a RC1.

Below is a simplified example of my configuration:

Code: Select all

[user]
menu1=Eye Protection Mode
cmd1=em_CMD
param1=@echo. & @echo To set this please edit regedit & @echo. & @echo "HKCU\Control Panel\Colors -> Window value to 235 255 235 or 202 234 206" & echo. & Pause & Start Regedit.exe & Pause

menu5=ROBOCOPY SYNC
cmd5=em_RoboCopy
param5="\\192.168.10.21\TENDERS" "C:\OneDrive\TENDERS" *.* /COPY:DAT /DCOPY:DA /MIR /R:1 /W:1 /MON:1 /MOT:1 /MT:32 /XF thumbs.db plot.log hardcopy.log "~$*.*" "*.dwl" "*.dwl2" desktop.ini "PlotandPublishLog*.CSV" /NP /NS /TEE /LOG+:C:\OneDrive\Logs\TENDER_%|DATE:~-4,4|%|DATE:~-7,2|%|DATE:~-10,2|.log
and the em_CMD is like this:

Code: Select all

[em_CMD]
cmd=%COMSPEC% /C
param=Start /D "%P"
menu=Command Prompt
button=%COMMANDER_EXE%,2

[em_RoboCopy]
button=%COMMANDER_EXE%,34
cmd=%COMSPEC% /K ROBOCOPY
menu=Robust File Copy for Windows (RoboCopy.exe)
This setup worked correctly in previous versions of TC.
However, in TC 11.57a RC it is not working anymore, the cmd.exe window not showing
Could you please help to check if there is any change in handling of parameters or user commands in this version? thanks
Total Commander 11.58 RC1 x64 #339325
Windows 11 Pro 25H2 x64
Everything 1.5b x64
Website | Github
Fla$her
Power Member
Power Member
Posts: 3973
Joined: 2020-01-18, 04:03 UTC

Re: [11.57a RC1] em command not working

Post by *Fla$her »

This setup worked correctly in previous versions of TC.
At least this is not correct:
/LOG+:C:\OneDrive\Logs\TENDER_%|DATE:~-4,4|%|DATE:~-7,2|%|DATE:~-10,2|.log
If I understood correctly, you need this:
/LOG+:C:\OneDrive\Logs\TENDER_%|$DATE:YMD|.log
The second mistake is that param=%A is not used here for em_RoboCopy.

Moreover, I don't see a practical advantage in using em_RoboCopy instead of %COMSPEC% /K ROBOCOPY. The savings here are minimal, while an unnecessary layer is used.
Last edited by Fla$her on 2026-05-20, 15:41 UTC, edited 1 time in total.
Overquoting is evil! 👎
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3970
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Re: [11.57a RC1] em command not working

Post by *sqa_wizard »

Obviously the user commands are not matching to the start menu entries.

parameter 1 sends commands to em_CMD. Note: em_CMD does not process any command (/K or /C) but starts a program (Start /D)
#5767 Personal license
User avatar
white
Power Member
Power Member
Posts: 6885
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [11.57a RC1] em command not working

Post by *white »

zhugecaomao wrote: 2026-05-20, 14:29 UTC This setup worked correctly in previous versions of TC.
Which versions exactly?

Concerning your "Eye Protection Mode" start menu entry:
"@echo" is not a command you can start. Move the parameters to the command field and it will work.
Did you move the parameters?
If it worked before, in which TC version?
User avatar
zhugecaomao
Junior Member
Junior Member
Posts: 89
Joined: 2022-08-23, 05:08 UTC
Contact:

Re: [11.57a RC1] em command not working

Post by *zhugecaomao »

2Fla$her 2sqa_wizard 2white

First of all, thank you all for your replies — I’ve learned quite a lot from the discussion.

Regarding the log file naming:

Code: Select all

/LOG+:C:\OneDrive\Logs\TENDER_%|DATE:~-4,4|%|DATE:~-7,2|%|DATE:~-10,2|.log
I have been using this format since Nov 2024, from TC 11.50 up to 11.57 final (including all intermediate beta versions), and it has been working fine.

That said, the following version you suggested is indeed cleaner and more concise — I wasn’t aware this syntax could be used in this way, so thanks for pointing it out:

Code: Select all

/LOG+:C:\OneDrive\Logs\TENDER_%|$DATE:YMD|.log
Regarding this point:
The second mistake is that param=%A is not used here for em_RoboCopy.
I’m not sure I fully understand this comment, as I don’t see param=%A used anywhere in my configuration. Could you please clarify?

About using em_RoboCopy:
Moreover, I don't see a practical advantage in using em_RoboCopy instead of %COMSPEC% /K ROBOCOPY. The savings here are minimal, while an unnecessary layer is used.
Yes, I agree this additional layer is not strictly necessary. The main reason I use em_RoboCopy is to assign a custom icon in the Start menu, so I can locate the command more quickly.

Regarding the mismatch between user commands and Start menu entries:
Obviously the user commands are not matching to the start menu entries.

parameter 1 sends commands to em_CMD. Note: em_CMD does not process any command (/K or /C) but starts a program (Start /D)
Yes, that is intentional. I use Start /D "%P" as a generic launcher for other commands as well, and I append & Pause in the parameter to keep the window open when needed.
Which versions exactly?

Concerning your "Eye Protection Mode" start menu entry:
"@echo" is not a command you can start. Move the parameters to the command field and it will work.
Did you move the parameters?
If it worked before, in which TC version?
I have been using this command since Nov 2024, across TC 11.50 up to 11.57 (including beta versions), and it was working in my setup.

I understand that placing content in the "command" field vs the "parameters" field behaves differently. My reasons for using the parameter field are:
1. Insert environment variable envvar in the parameters field. Using %envvar% directly isn't possible, because the % sign is already used for placeholders. Therefore this modified syntax needs to be used. The "command" field still uses the normal %envvar% field. (when I start to use this command, this function is not available yet if I am not wrong)
2. The presence or absence of parameters affects how icons are displayed in the TC Start menu, which also influenced my setup.

Moderator message from: white » 2026-05-21, 13:25 UTC

Replaced some code markup codes with quote markup codes to keep it readable for users.
Total Commander 11.58 RC1 x64 #339325
Windows 11 Pro 25H2 x64
Everything 1.5b x64
Website | Github
Fla$her
Power Member
Power Member
Posts: 3973
Joined: 2020-01-18, 04:03 UTC

Re: [11.57a RC1] em command not working

Post by *Fla$her »

zhugecaomao wrote: 2026-05-21, 01:24 UTCand it has been working fine.
Let's say, this worked provided that the current regional settings matched the location of the date components. Therefore, the cmd variable %date% is usually avoided in good code, which cannot be said about the pseudovariable %$DATE%, which can be controlled using placeholders.
zhugecaomao wrote: 2026-05-21, 01:24 UTCI’m not sure I fully understand this comment, as I don’t see param=%A used anywhere in my configuration. Could you please clarify?
That is exactly what I wrote. I have long forgotten how reading parameters through the Start menu works, since I haven't used it for a very long time due to the very limited set of hotkeys and standard names of cm_commands. I would have used another em command instead, and there, to pass the remaining parameters, %A is already required:

Code: Select all

[em_RoboCopySync]
menu=ROBOCOPY SYNC
cmd=em_RoboCopy
param=""\\192.168.10.21\TENDERS" "C:\OneDrive\TENDERS" *.* /COPY:DAT /DCOPY:DA /MIR /R:1 /W:1 /MON:1 /MOT:1 /MT:32 /XF thumbs.db plot.log hardcopy.log "~$*.*" "*.dwl" "*.dwl2" desktop.ini "PlotandPublishLog*.CSV" /NP /NS /TEE /LOG+:C:\OneDrive\Logs\TENDER_%|DATE:YMD|.log"

[em_RoboCopy]
button=%COMMANDER_EXE%,34
cmd=%COMSPEC% /K ROBOCOPY
param=%A
menu=Robust File Copy for Windows (RoboCopy.exe)
It's clear that editing an mnu file is more difficult to adapt the same functionality, but it's only a matter of time and a slightly more effort.
Overquoting is evil! 👎
User avatar
Native2904
Senior Member
Senior Member
Posts: 423
Joined: 2014-01-30, 14:23 UTC
Location: Aachen

Re: [11.57a RC1] em command not working

Post by *Native2904 »

2zhugecaomao

for managing screen color temperature there is a use tiny portable tool:

LightBulb
Glückauf
#270101 Single user licence.
Total Commander 64-bit – latest version – Windows 11 Pro 24H2
User avatar
zhugecaomao
Junior Member
Junior Member
Posts: 89
Joined: 2022-08-23, 05:08 UTC
Contact:

Re: [11.57a RC1] em command not working

Post by *zhugecaomao »

thanks Fla$her, I’ve modified my command as follows, and it works again now:

Code: Select all

[em_RoboCopy]
button=%COMMANDER_EXE%,34
cmd=Robocopy.exe
menu=Robust File Copy for Windows (RoboCopy.exe)
param=%A

[em_cmd]
cmd=%COMSPEC% /K
param=%A
menu=Command Prompt
button=%COMMANDER_EXE%,2

[user]
menu1=Eye Protection Mode
cmd1=em_cmd
param1=@echo. & @echo To set this please edit regedit & @echo. & @echo "HKCU\Control Panel\Colors -> Window value to 235 255 235 or 202 234 206" & echo. & Pause & Start Regedit.exe & Pause

menu5=ROBOCOPY SYNC (TENDERS)
cmd5=em_RoboCopy
param5="\\192.168.10.21\TENDERS" "C:\OneDrive\TENDERS" *.* /COPY:DAT /DCOPY:DA /MIR /R:1 /W:1 /MON:1 /MOT:1 /MT:32 /XF thumbs.db plot.log hardcopy.log "~$*.*" "*.dwl" "*.dwl2" desktop.ini "PlotandPublishLog*.CSV" /NP /NS /TEE /LOG+:C:\OneDrive\Logs\TENDER_%|$DATE:YMD|.log
Not sure why my previous (incorrect) setup was still working before 😅

Thanks again for the help!
Last edited by zhugecaomao on 2026-05-21, 06:09 UTC, edited 1 time in total.
Total Commander 11.58 RC1 x64 #339325
Windows 11 Pro 25H2 x64
Everything 1.5b x64
Website | Github
User avatar
zhugecaomao
Junior Member
Junior Member
Posts: 89
Joined: 2022-08-23, 05:08 UTC
Contact:

Re: [11.57a RC1] em command not working

Post by *zhugecaomao »

Native2904 wrote: 2026-05-21, 05:51 UTC 2zhugecaomao

for managing screen color temperature there is a use tiny portable tool:

LightBulb
thanks, i will try it
Total Commander 11.58 RC1 x64 #339325
Windows 11 Pro 25H2 x64
Everything 1.5b x64
Website | Github
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 52920
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [11.57a RC1] em command not working

Post by *ghisler(Author) »

I would like to keep compatibility with older versions, but for that I need to figure out what's wrong.
About this line:
/LOG+:C:\OneDrive\Logs\TENDER_%|DATE:~-4,4|%|DATE:~-7,2|%|DATE:~-10,2|.log
What does the variable %DATE% contain? On my system it's not set. I assume that there is the year at the end, the month 7 from the end, and the day at position -10. So when I call
set DATE=21.05.2026
in cmd.exe and then run Totalcmd, a button with parameter
?/LOG+:C:\OneDrive\Logs\TENDER_%|DATE:~-4,4|%|DATE:~-7,2|%|DATE:~-10,2|.log
Shows this in a dialog box:
/LOG+:C:\OneDrive\Logs\TENDER_20260521.log
So I wonder where the problem is?
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 17310
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: [11.57a RC1] em command not working

Post by *petermad »

On my system it's not set.
%DATE% is a dynamic environment variable - it will not turn up in the list when you type SET at the command prompt

You are not supposed to use:

Code: Select all

set DATE
- the systems sets it dynamically.

Other dynamic variables are:
%CD%
%TIME%
%RANDOM%
%ERRORLEVEL%
%CMDEXTVERSION%
%CMDCMDLINE%
%HIGHESTNUMANODENUMBER%

The output of for example:

Code: Select all

echo %DATE%
depends on the systems locale - so it is not very usable for scripts that are meant to be used universally.

In Danish the output is: 21-05-2026
In English (US) it is: Thu 05/21/2026
In English (UK) it is: 21/05/2026
In German it is: 21.05.2026
In English (Philippines) it is: 5/21/2026
License #524 1994
Danish TC Translator
TC 11.57 32+64bit on Windows XP 32bit & Windows 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1413b
TC 3.62 on Android 6, 13, 15 & 16
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
AntonyD
Power Member
Power Member
Posts: 2142
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: [11.57a RC1] em command not working

Post by *AntonyD »

Russian - 21 мая 2026 г.
Obviously that we can't get the same sub-elements inside such different input strings...
#146217 personal license
User avatar
zhugecaomao
Junior Member
Junior Member
Posts: 89
Joined: 2022-08-23, 05:08 UTC
Contact:

Re: [11.57a RC1] em command not working

Post by *zhugecaomao »

ghisler(Author) wrote: 2026-05-21, 12:12 UTC I would like to keep compatibility with older versions, but for that I need to figure out what's wrong.
Thanks for looking into this.

Let me summarize the behavior more clearly:

I have been using several em_ user commands together with TC Start menu entries on a daily basis since Nov 2024, across versions from TC 11.50 up to 11.57 final (including all beta versions in between).

In all these versions, my setup worked consistently — even though, as discussed, some parts of the command might not be correct.

However, after updating to TC 11.57a RC1 today, the same Start menu entries no longer work:
- No Command Prompt window is opened
- No visible error message

The command I used is:

Code: Select all

[em_CMD]
cmd=%COMSPEC% /C
param=Start /D "%P"
menu=Command Prompt
button=%COMMANDER_EXE%,2

[em_RoboCopy]
button=%COMMANDER_EXE%,34
cmd=%COMSPEC% /K ROBOCOPY
menu=Robust File Copy for Windows (RoboCopy.exe)
The TC Start menu setup is:

Code: Select all

[user]
menu1=Eye Protection Mode
cmd1=em_CMD
param1=@echo. & @echo To set this please edit regedit & @echo. & @echo "HKCU\Control Panel\Colors -> Window value to 235 255 235 or 202 234 206" & echo. & Pause & Start Regedit.exe & Pause

menu5=ROBOCOPY SYNC
cmd5=em_RoboCopy
param5="\\192.168.10.21\TENDERS" "C:\OneDrive\TENDERS" *.* /COPY:DAT /DCOPY:DA /MIR /R:1 /W:1 /MON:1 /MOT:1 /MT:32 /XF thumbs.db plot.log hardcopy.log "~$*.*" "*.dwl" "*.dwl2" desktop.ini "PlotandPublishLog*.CSV" /NP /NS /TEE /LOG+:C:\OneDrive\Logs\TENDER_%|DATE:~-4,4|%|DATE:~-7,2|%|DATE:~-10,2|.log
Total Commander 11.58 RC1 x64 #339325
Windows 11 Pro 25H2 x64
Everything 1.5b x64
Website | Github
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 52920
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [11.57a RC1] em command not working

Post by *ghisler(Author) »

I figured it out, it's a bug in the recursed call detection:
10.05.26 Fixed: Prevent recursion when an em_command calls itself, e.g. usercmd.ini [em_recurse] cmd=em_recurse (32/64)
I will fix it, sorry for the troubles.

It only happens when using a single command em_command with something in the "parameters" field.
Author of Total Commander
https://www.ghisler.com
User avatar
zhugecaomao
Junior Member
Junior Member
Posts: 89
Joined: 2022-08-23, 05:08 UTC
Contact:

Re: [11.57a RC1] em command not working

Post by *zhugecaomao »

ghisler(Author) wrote: 2026-05-22, 07:16 UTC I figured it out, it's a bug in the recursed call detection:

It only happens when using a single command em_command with something in the "parameters" field.
Thanks for the clarification, this is also a good opportunity for me to improve my em_command implementation and related scripts.

thanks to the following friends as well:-
2Fla$her
2sqa_wizard
2white
2Native2904
2petermad
2AntonyD
Total Commander 11.58 RC1 x64 #339325
Windows 11 Pro 25H2 x64
Everything 1.5b x64
Website | Github
Post Reply