Batch Date Time breaks before 10am Windows 8 -


good day - able assist me below query.

desired result need directory 25-08-2015-10-15 (dd/mm/yy-hh:mm)

before 10 directory 8-22(hh-mm) after 10 writes :25-08-2015-10-15 (dd-mm-yy-hh-mm)

below batch file:

set dd=%date:~0,2% set mm=%date:~3,2% set yy=%date:~8,2% set yyyy=%date:~6,4% set hh=%time:~0,2% set mm=%time:~3,2%  mkdir \makereport\%folderdate% set folderdate=%date:~0,2%-%date:~3,2%-%date:~6,4%-%time:~0,2%-%time:~3,2%  mkdir \makereport\%folderdate%  rem copy file date/time copy \makereport\*.csv \makereport\%folderdate%\  cd %folderdate% rem 7z.exe location  path = c:\batch 7z retail.zip *.csv -pretailpass@ rem subject line email mkdir \makereport\%folderdate%\retail_%folderdate% cd.. del *.csv 

i have tried add:

if "%time:~0,1%" == " " (set folderdate=0%time:~1,1%) else set folderdate=%time:~0,2%  echo folderdate=%date:~6%%date:~3,2%%date:~0,2%_%folderdate%%time:~3,2% 

but must doing wrong.

add lower line - think should fix issue space @ start of time before 10am.

other solutions exist may 1 after.

set hh=%time:~0,2% set hh=%hh: =0% 

Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -