I have a batch file where I have a variable which prints date in YYYYMMDD - 20160403
for /F "usebackq tokens=1,2 delims==" %%i in (`wmic os get LocalDateTime /VALUE 2^>NUL`) do if '.%%i.'=='.LocalDateTime.' set ldt=%%j
set ldt=%ldt:~0,4%%ldt:~4,2%%ldt:~6,2%
echo Local date is %ldt%
then I am downloading a file which has the date a the end of the url
curl "http://www.example.com/cgi-bin/abc.xyz/%ldt%.txt" -o file-name-%ldt%.txt
where %ldt% has the date for eg: 20160403
but now I am not able to print the date. Any suggesstions ?