0

I have this following piece of code

FOR %%o IN (realese/randdraw.exe) DO set modified=%%~to

for /f %%f in ('dir /b src ') do (
    FOR %%? IN (src/%%f) DO (

    ECHO Last-Modified Date   : %%~t?
    if %%~t? GTR %modified% echo yes :: PART IN QUESTION

)
)

The goal of this program is to compare the modified dates of several files. However when you get the modified date for a file its return format is mm/dd/yyyy hh:mm (10/02/2022 05:00 PM). So my question is how would one compare the 2?

Wemmons53
  • 46
  • 3
  • Use PowerShell instead! – Compo Oct 03 '22 at 08:52
  • Or write batch-file subroutine to convert every string like **10/02/2022 05:00 PM** to integer value. Then compare file date values by subroutine calling. Something like [Converting the date modified of a file into a UNIX timestamp](https://stackoverflow.com/questions/57459148/) – Daemon-5 Oct 03 '22 at 10:01

0 Answers0