[TC 11 B5] New pseudo environment variable "%$DATE%" doesn't work in button

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
PiotrMPPL
Junior Member
Junior Member
Posts: 44
Joined: 2018-10-26, 07:04 UTC

[TC 11 B5] New pseudo environment variable "%$DATE%" doesn't work in button

Post by *PiotrMPPL »

New pseudo environment variable "%$DATE%" doesn't work in button

ex
param1=?%$DATE%

Result: DATE
User avatar
Stefan2
Power Member
Power Member
Posts: 4157
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: [TC 11 B5] New pseudo environment variable "%$DATE%" doesn't work in button

Post by *Stefan2 »

I hope this is still true:

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:
%|Variable name|
%|$DATE|
%|$DATE:Y-M-D h.m.s|
%$DATE% can be used in the command field /command line



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
Results in
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
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" 


 
PiotrMPPL
Junior Member
Junior Member
Posts: 44
Joined: 2018-10-26, 07:04 UTC

Re: [TC 11 B5] New pseudo environment variable "%$DATE%" doesn't work in button

Post by *PiotrMPPL »

How to make a button that creates 7z archives with timestamp yyyymmddhhmmss ?
User avatar
Stefan2
Power Member
Power Member
Posts: 4157
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: [TC 11 B5] New pseudo environment variable "%$DATE%" doesn't work in button

Post by *Stefan2 »

PiotrMPPL wrote: 2023-06-05, 08:10 UTC How to make a button that creates 7z archives with timestamp yyyymmddhhmmss ?
Ask Horst >> https://ghisler.ch/board/viewtopic.php?p=431816#p431816





 
PiotrMPPL
Junior Member
Junior Member
Posts: 44
Joined: 2018-10-26, 07:04 UTC

Re: [TC 11 B5] New pseudo environment variable "%$DATE%" doesn't work in button

Post by *PiotrMPPL »

Why %|$DATE| not %$DATE% ?
User avatar
Stefan2
Power Member
Power Member
Posts: 4157
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: [TC 11 B5] New pseudo environment variable "%$DATE%" doesn't work in button

Post by *Stefan2 »

PiotrMPPL wrote: 2023-06-05, 08:42 UTC Why %|$DATE| not %$DATE% ?


read my first answer




 
PiotrMPPL
Junior Member
Junior Member
Posts: 44
Joined: 2018-10-26, 07:04 UTC

Re: [TC 11 B5] New pseudo environment variable "%$DATE%" doesn't work in button

Post by *PiotrMPPL »

Why did you use the "-stl" switch?
User avatar
Stefan2
Power Member
Power Member
Posts: 4157
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: [TC 11 B5] New pseudo environment variable "%$DATE%" doesn't work in button

Post by *Stefan2 »

PiotrMPPL wrote: 2023-06-05, 09:35 UTC Why did you use the "-stl" switch?
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).





 
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6480
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: [TC 11 B5] New pseudo environment variable "%$DATE%" doesn't work in button

Post by *Horst.Epp »

PiotrMPPL wrote: 2023-06-05, 09:35 UTC Why did you use the "-stl" switch?
-stl : set archive timestamp from the most recently modified file
Windows 11 Home x64 Version 23H2 (OS Build 22631.3447)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.2 x64
Post Reply