timestamp - batch date time stamp compare -


hey have little batch file supposed compare timestamps of 2 files , return errorvlvl 0 or 2 depending on whether source file newer or not (it gets passed 2 filenames parameters) dont think gtr workig right timestamps.. works of time , not others...how parse timespamps integers compare them. btw variables source , dest (i echoed them see)
05/06/2012 18:46

 rem use t prefix here expand file location parameters passed in,        date/time values set source=%~t1 echo %dest% set dest=%~t2 echo %source%  if "%source%" gtr "%dest%" goto overwrite exit /b 0  :overwrite rem if source file newer compare.bat return errorlevel of 2,    used in if statement in file called compare.bat go ahead , overwrite older file exit /b 2  

thanks in advance advice!! :)

ok. got .. think!

set compsource= %dest:~6,4%%dest:~3,2%%dest:~0,2%%dest:~6,4%%dest:~11,2%%dest:~14,2% 

Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -