The first four lines of this code will give you reliable YY DD MM YYYY HH Min Sec variables in XP Pro and higher.
The variable is in the log file name below:
@echo off
for /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a"
set "YY=%dt:~2,2%" & set "YYYY=%dt:~0,4%" & set "MM=%dt:~4,2%" & set "DD=%dt:~6,2%"
set "HH=%dt:~8,2%" & set "Min=%dt:~10,2%" & set "Sec=%dt:~12,2%"
set "fullstamp=%YYYY%-%MM%-%DD%_%HH%-%Min%-%Sec%"
cd /d "C:\Users\310152922\Desktop\Mohit Task\Lumi_FTP"
java Lumi_FTP "C:\Users\310152922\Desktop\Mohit Task\Lumi_FTP\lumi_ftp_settings.ini" >"C:\test\Scriptlogs\log_DP_%fullstamp%.txt"