Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Last modified file
Name: jstormoen Date: June 22, 2004 at 07:22:22 Pacific OS: Windows 2000 CPU/Ram: 2.4 Ghz
Comment:
I need to find and copy the last modified file in a directory. I cannot find how to find the last modified file (random naming) so cannot use that.
Name: jstormoen Date: June 22, 2004 at 08:38:26 Pacific
Reply:
Alright figured it out - used the dir /O:D to sort by date and time and set a var with the results. As you come out of the loop the value of the variable is the last modified filename:
@ECHO OFF
for /F "usebackq" %%A IN (`dir /O:D /B *.csv`) do ( set FI=%%A ) copy %fi% warehouse.csv
Summary: Use this, instead: setlocal set LIST= for %%I in (*.tif) do set LIST=%%~fI ren %LIST%.tif %LIST%.--- (...) ren %LIST%.--- %LIST%.tif endlocal However, that will get the last modified .tif file from th...
Summary: This will do what you ask, but I think you are trying to test for WIN Version. I usually check for the modification date/time of a basic core system file to do this. For example for W98SE, %windir%\WI...