If you can use PowerShell, that would be your best bet. Then you can use Get-Date (or [datetime]::Now, or New-Object DateTime, ...) to get a .NET DateTime object, which you can easily format.
for /f "tokens=2 delims==" %%I in ('wmic os get localdatetime /format:list') do set datetime=%%I
set thedate=%datetime:~0,4%%datetime:~4,2%%datetime:~6,2%
rclone lsd wasabi01:testfolder01/%thedate%
woud output
rclone ls wasabi01:testfolder01/20210828
275 file.txt
Wow ! Many thanks albertony. You don't know how much it helped me! I much appreciated!
I went for your solution with Powershell, and it finally worked like a charm.
As I have spent quite a few hours trying to understand this, here is what I have done in case it can help someone else (with explanations on how to automate the script with Windows Task scheduler) :
(Assuming you have already Powershell installed on your computer)
I have created a txt file. I renamed it test.ps1
Then right-click on the "test.ps1" file and select open
Then paste the code :
In fact, do not use this one! :
Use this one : (add the path where your rclone.exe is located, otherwise it won't load latter on with Windows Task scheduler! And I have also added the log info into a local log file. Like that, I can be sure that it has run)
Then add a Windows Task schedule to it (see image 2021-08-28-162159.png ):
Program :
powershell
Add arguments :
-NoLogo -NoProfile -NonInteractive -File "C:\prog\rclone\Kv.ps1"
(please notice the quotes after File as I had this problem)