5
1
I want to know when a file has been modified for the last time.
I can get these infos using the following batch script:
FOR %%i IN (myfile) DO SET modif_time=%%~ti
The problem is that I need the second of the last modification and the command %~t
returns the date and the time with only hours and minutes.
I can only check the seconds by manually viewing the "property window" file by file.
How can I get the time with seconds in batch?
Are you really sure that with
– Rik – 2014-01-10T12:57:50.090dir /od
the files aresorted "randomly"
if made in the same minute? For me thecmd
does the sorting correctly (despite the fact it doesn't show the seconds). You can follow these instruction to get the seconds in the property-dialog in explorer to make sure.1
And if you really want the seconds in your script you might want to consider executing a powerscript-command to get it. See here for a solution.
– Rik – 2014-01-10T13:02:01.667I controlled again and the files are NOT sorted randomly but in the correct way even if the minute is the same. Maybe I made something wrong the first time I checked. My error. Thank you. @Rik – user3133076 – 2014-01-19T09:05:59.840