Hi,
I need to create a batch file to open the last modified excel file in a folder C:\Test\Unit 2. This folder also contained several sub-folders and the last modified file may exists in any of the sub-folders. I’ve been reading several posts in this forum on opening the latest modified file but still couldn’t find the solution. I’m using Windows 7 64-bit. Any help is very much appreciated
Thanks
Run this and post a few lines of the output.
:: ==========================================
::
:: bydate.bat Wed 25-05-2011 18:19:47.17
@echo off & setLocal enableDELAYedeXpansioN
for /f “tokens=* delims= ” %%a in (‘dir/b/s/a-d’) do (
echo.%%~Ta %%a
)
If dir/b/s/a-d doesn’t show them, it’s anybody’s guess.
Dear M2
I used
do (
start excel “%%a”
goto :eof
)
instead of
do (
echo.%%~Ta %%a
)
and it works. Thanks a lot for your guidance