%$DATE% only resolved in command field
Moderators: Hacker, petermad, Stefan2, white
%$DATE% only resolved in command field
The new date variable %$DATE% is only resolved in the command field of a button.
This makes it useless for most purposes.
It should be resolved as parameters.
This makes it useless for most purposes.
It should be resolved as parameters.
Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
Re: %$DATE% only resolved in command field
On TC11b3 x32 doesn't work.
Command: %ComSpec% /k echo %$DATE%
Parameters: ?%|$DATE:Y-M-D h.m.s|
Returns: %$DATE% %$DATE:Y-M-D h.m.s%
Command: %ComSpec% /k echo %$DATE%
Parameters: ?%|$DATE:Y-M-D h.m.s|
Returns: %$DATE% %$DATE:Y-M-D h.m.s%
Overquoting is evil! 👎
Re: %$DATE% only resolved in command field
Strange - fully works here on both x32 and x64 versions on Windows 10
Re: %$DATE% only resolved in command field
I can confirm that it works at my place as well, with both TC versions running on Win10 x64.
Support for the suggestion.
Support for the suggestion.
Re: %$DATE% only resolved in command field
Fla$her wrote:On TC11b3 x32 doesn't work.
Command: %ComSpec% /k echo %$DATE%
Parameters: ?%|$DATE:Y-M-D h.m.s|
Here, the above works fine on Windows 7 and 10, but NOT on Windows XPFla$her wrote:And on XP and 7 how?
On Windows XP it does not work for neither the Command field nor the Parameters field.
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
Re: %$DATE% only resolved in command field
Works on Windows 7, on XP i didn't try.
Re: %$DATE% only resolved in command field
2petermad
Confirm. I tested it on XP first. Probably, the same problems exist on earlier versions.
Confirm. I tested it on XP first. Probably, the same problems exist on earlier versions.
%|var|, which appeared in the first beta, applies to all environment variables. There's nothing to add.
Overquoting is evil! 👎
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: %$DATE% only resolved in command field
The function to load the %$pseudovar% variables loads and uses the function SHGetKnownFolderPath, which doesn't exist on Windows XP.
I will check for $DATE before trying to load SHGetKnownFolderPath.
I will check for $DATE before trying to load SHGetKnownFolderPath.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: %$DATE% only resolved in command field
And what will it give?ghisler(Author) wrote: 2023-05-18, 06:59 UTC I will check for $DATE before trying to load SHGetKnownFolderPath.
Overquoting is evil! 👎
Re: %$DATE% only resolved in command field
A very simple test under Windows 11 shows that %$DATE% doesn't work in the parameters of a button.
The button starts a cmd script which echos the parameters.
Using the %$DATE% in the command field after the cmd path it works and delivers a date.
If %$DATE% is in the parameters field it simply gets DATE
The button starts a cmd script which echos the parameters.
Using the %$DATE% in the command field after the cmd path it works and delivers a date.
If %$DATE% is in the parameters field it simply gets DATE
Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: %$DATE% only resolved in command field
It will work also on older Windows versions where SHGetKnownFolderPath doesn't exist, like Windows XP.
%|Variable name|
The parameters field does not support environment variables normally because it supports paramters like %P%N. This would collide with a variable name %P%. Therefore the syntax is different there:A very simple test under Windows 11 shows that %$DATE% doesn't work in the parameters of a button.
%|Variable name|
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: %$DATE% only resolved in command field
Good! Thanks for the explanation.It will work also on older Windows versions where SHGetKnownFolderPath doesn't exist, like Windows XP.
Overquoting is evil! 👎
Re: %$DATE% only resolved in command field
Ok, now I can use it
Here my button to pack all selected files/dirs from the source to the target side.
The archive is named like the source dir followed by the current date time.
Example Dirname_20230518_1845

Here my button to pack all selected files/dirs from the source to the target side.
The archive is named like the source dir followed by the current date time.
Example Dirname_20230518_1845
Code: Select all
TOTALCMD#BAR#DATA
"C:\Program Files\7-Zip\7z.exe"
a %T%B_%|$DATE:YMD_hm| @%UL -aoa -mmt -mx9 -ssw -stl -ssp -y -mx9
C:\Program Files\7-Zip\7zFM.exe
Pack selected
-1
Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64