Error message

Deprecated function: The each() function is deprecated. This message will be suppressed on further calls in _menu_load_objects() (line 579 of /www/webvol38/16/9svvwb3gxs5tmhv/benzzon.se/public_html/includes/menu.inc).

BAT: Get file with latest date..

1 post / 0 new
benzzon
benzzon's picture
BAT: Get file with latest date..

----- batch begins ------- 

@echo off
set ynf=
for /f "delims=" %%i in ( ' dir /b /o:d /a:-d "C:\documents and settings" ' ) do set ynf=%%i
if defined ynf echo newest file is "%ynf%"
if not defined ynf echo "no files were found"
 
------ batch ends --------