site Search:


 
    All Forums Hot Topics Gallery






how-to block ads


 
Search Topic:
Uniqs:
8449
Share Topic
Posting?
Post a:
Post a:
Links: ·How To Get Noticed ·Web Monks FAQ ·Webhosting FAQ ·Posting Code ·How To Post ·Webhosting forum
AuthorAll Replies


LuckY7
Go Cubs

join:2002-04-07
Lake Zurich, IL

1 edit

[dos batch] - how to read the newest file name from a folder

Hi,

I am trying to read and then copy the name of the 1st or latest file in a folder called c:\backup. This is so when I do a restore, I always have the most current file name I am using. Any ideas?

Thanks.
--
__-= Comcast cable, linksys BEFSR41 Router(1.45.7 firm), TyanS2099A w/ p4 2.66GHz, ATI 9600pro, cable_TV =-__


sdgthy

@optonline.net

The command: dir /a:-d /b /o:d /t:w
Will have the name of the last modified file on the last line.



GeekNJ
Premium
join:2000-09-23
Waldwick, NJ

reply to LuckY7
Found the below. Maybe it helps.

@echo off
for /f "delims=" %%x in ('dir /od /a-d /b *.*') do set recent=%%x
echo %recent%
 

Wednesday, 19-Jun 22:22:23 Terms of Use & Privacy | feedback | contact | Hosting by nac.net - DSL,Hosting & Co-lo
over 13.5 years online © 1999-2013 dslreports.com.
Most commented news this week
Hot Topics