Search found 7 matches

by smccaffr39
24 Apr 2012 13:00
Forum: DOS Batch Forum
Topic: Finding newest file in all subdirectories
Replies: 33
Views: 51262

Re: Finding newest file in all subdirectories

wow, thanks. that's pretty slick. i'll give it a whirl.
by smccaffr39
24 Apr 2012 12:44
Forum: DOS Batch Forum
Topic: Finding newest file in all subdirectories
Replies: 33
Views: 51262

Re: Finding newest file in all subdirectories

just to add to this, i am looking for the newest modified in all sub-directories. here's what i've come up with as an end-result. @ECHO OFF SETLOCAL ENABLEDELAYEDEXPANSION SET FFPath=\\Server1\Folder1\ SET NewPath=\\Server2\Folder2 REM Arbitrary yyyymmdd starting point, nothing will be older than it...
by smccaffr39
24 Apr 2012 09:14
Forum: DOS Batch Forum
Topic: Finding newest file in all subdirectories
Replies: 33
Views: 51262

Re: Finding newest file in all subdirectories

good stuff. thanks for your help!
by smccaffr39
24 Apr 2012 07:47
Forum: DOS Batch Forum
Topic: Finding newest file in all subdirectories
Replies: 33
Views: 51262

Re: Finding newest file in all subdirectories

You will need nested for loops. The first one to get a list of the directories, then a 2nd one to then list the files within that directory. I wouldn't use PATH as a variable name in a batch file unless you actually want to change that environmental variable. SET sPath=\\server\path pushd "%sP...
by smccaffr39
24 Apr 2012 06:42
Forum: DOS Batch Forum
Topic: Finding newest file in all subdirectories
Replies: 33
Views: 51262

Re: Finding newest file in all subdirectories

I am not clear about the question. Do you want the single most recently modified file across all subdirectories? (total of one file) Or do you want the most recently modified file for each subdirectory? (one file per directory) Dave Benham hi Dave. i need a total of one file retrieved from all sub-...
by smccaffr39
23 Apr 2012 11:23
Forum: DOS Batch Forum
Topic: Finding newest file in all subdirectories
Replies: 33
Views: 51262

Finding newest file in all subdirectories

hello all. i need a DOS batch script that can find the newest file in all sub-directories. i have tried this: SET Path=\\server\path FOR /F "delims=|" %%I IN ('DIR "%Path%" /B /S /A:-D /O:D') DO (SET NewestFile=%%I) but the problem is that it ends up returning the newest file fro...