I am compressing files using WinZip on the command line. Since we archive on a daily basis, I am trying to add date and time to these files so that a new one is auto generat
Extract the hour, look for a leading space, if found replace with a zero;
set hr=%time:~0,2% if "%hr:~0,1%" equ " " set hr=0%hr:~1,1% echo Archive_%date:~-4,4%%date:~-10,2%%date:~-7,2%_%hr%%time:~3,2%%time:~6,2%.zip