[TC 11 B5] New pseudo environment variable "%$DATE%" doesn't work in button
Moderators: Hacker, petermad, Stefan2, white
[TC 11 B5] New pseudo environment variable "%$DATE%" doesn't work in button
New pseudo environment variable "%$DATE%" doesn't work in button
ex
param1=?%$DATE%
Result: DATE
ex
param1=?%$DATE%
Result: DATE
Re: [TC 11 B5] New pseudo environment variable "%$DATE%" doesn't work in button
I hope this is still true:
Results in
2023-06-05 - - - - 2023-06-05 09.39.27
Another usage:
or create new text file with current timestamp "2023-06-05 09.48.14.txt" in name
With an leading ? in the parameter box:
cmd /c
?copy nul "%|$DATE:Y-M-D h.m.s|.%.txt"
you will be prompted so you can inspect the command line to execute and /or add something:
copy nul "2023-06-05 09.50.32.txt"
copy nul "2023-06-05 09.50.32---done.txt"
%$DATE% can be used in the command field /command lineThe 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:
%|Variable name|
%|$DATE|
%|$DATE:Y-M-D h.m.s|
Code: Select all
TOTALCMD#BAR#DATA
cmd /k echo %$DATE:Y-M-D% - - - -
%|$DATE:Y-M-D h.m.s|
wcmicons.dll,1
TEST $DATE
-1
2023-06-05 - - - - 2023-06-05 09.39.27
Another usage:
Code: Select all
TOTALCMD#BAR#DATA
cmd /c
COPY "%N" "%O_Backup_%|$DATE:Y-M-D h.m.s|.%E"
wcmicons.dll,1
TEST $DATE - Backup selected file to oldname_timestamp.ext
-1
or
Code: Select all
TOTALCMD#BAR#DATA
cmd /c
copy nul "%|$DATE:Y-M-D h.m.s|.%.txt"
wcmicons.dll,1
TEST $DATE - create new text file with current timestamp in name
-1
With an leading ? in the parameter box:
cmd /c
?copy nul "%|$DATE:Y-M-D h.m.s|.%.txt"
you will be prompted so you can inspect the command line to execute and /or add something:
copy nul "2023-06-05 09.50.32.txt"
copy nul "2023-06-05 09.50.32---done.txt"
Re: [TC 11 B5] New pseudo environment variable "%$DATE%" doesn't work in button
How to make a button that creates 7z archives with timestamp yyyymmddhhmmss ?
Re: [TC 11 B5] New pseudo environment variable "%$DATE%" doesn't work in button
Ask Horst >> https://ghisler.ch/board/viewtopic.php?p=431816#p431816PiotrMPPL wrote: 2023-06-05, 08:10 UTC How to make a button that creates 7z archives with timestamp yyyymmddhhmmss ?
Re: [TC 11 B5] New pseudo environment variable "%$DATE%" doesn't work in button
Why %|$DATE| not %$DATE% ?
Re: [TC 11 B5] New pseudo environment variable "%$DATE%" doesn't work in button
Why did you use the "-stl" switch?
Re: [TC 11 B5] New pseudo environment variable "%$DATE%" doesn't work in button
You have understood that I am NOT the author of that button script linked above?
Ask Horst in that other thread linked above (or yet better read the 7z command line syntax to get the answer).
Re: [TC 11 B5] New pseudo environment variable "%$DATE%" doesn't work in button
-stl : set archive timestamp from the most recently modified file
Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.55 RC1 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.55 RC1 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