Pages

Thursday, May 19, 2016

To list the Current Date File In DOS

To list the Current Date File In DOS

       
command :

dir  |find "%date:~4,2%/%date:~7,2%/%date:~10,4% " |more


dir  |find "09/29/2012" |more


Example:

D:\TESTT>dir
Volume in drive D has no label.
Volume Serial Number is 86F0-0843

Directory of D:\TESTT

09/26/2012  02:42 PM    <DIR>          .
09/26/2012  02:42 PM    <DIR>          ..
09/25/2012  01:26 PM            46,547 a
09/25/2012  01:00 PM                 0 b.txt
09/25/2012  01:01 PM                 0 c.txt
09/25/2012  01:01 PM                 0 d.txt
09/25/2012  01:01 PM                 0 e.txt
09/25/2012  01:01 PM                 0 f.txt
09/25/2012  01:01 PM                 0 g.txt
09/26/2012  02:02 PM                10 HELLO_26092012-140226.log
09/26/2012  02:41 PM                10 HELLO_26092012-144127.log
09/26/2012  02:42 PM                10 HELLO_26092012-144204.log
09/26/2012  02:42 PM                10 HELLO_26092012-144211.log
09/26/2012  02:42 PM                10 HELLO_26092012-144213.log
09/26/2012  02:42 PM                 0 hello_timestamp.log
              13 File(s)         46,597 bytes
               2 Dir(s)  310,694,817,792 bytes free

D:\TESTT>echo %date%Sat 09/29/2012

D:\TESTT>type HELLO_26092012-140226.log >today.log

D:\TESTT>type HELLO_26092012-140226.log >today1.log

D:\TESTT>
D:\TESTT>echo %date%
Sat 09/29/2012

D:\TESTT>dir  |find "%date:~4,2%/%date:~7,2%/%date:~10,4% " |more
09/29/2012  02:28 PM    <DIR>          .
09/29/2012  02:28 PM    <DIR>          ..
09/29/2012  02:28 PM                10 today.log
09/29/2012  02:28 PM                10 today1.log


D:\TESTT> dir  |find "09/29/2012" |more
09/29/2012  02:28 PM    <DIR>          .
09/29/2012  02:28 PM    <DIR>          ..
09/29/2012  02:28 PM                10 today.log
09/29/2012  02:28 PM                10 today1.log

No comments:

Post a Comment