This thread is a bit old
, but I just ran into the same problem.
By combining cmd-substrings and delayed environment variable expansion, I was able to produce the following native (Windows 10) one-liner:
Command:Parameters:This demo button produces a cmd.exe window with the following text:A bit ugly, but it works.

By combining cmd-substrings and delayed environment variable expansion, I was able to produce the following native (Windows 10) one-liner:
Command:
Code:
cmd /V:ON /K
Code:
"set "ZZZZ=%T" && echo "target=%T" && echo "target_fixed=!ZZZZ:~0,-1!" && echo "source=%P%S""
Code:
"target=c:\Temp\2\""target_fixed=c:\Temp\2""source=c:\Temp\1"
Statistics: Posted by igor3v — 2024-08-13, 15:07 UTC