I have created a batch file which redirects into a plain text file. What the batch does is goes to the mentioned path and there dir command gets executed and the output will be directed to a text file.
Now when i open the text file i see the whole tree, but i want only one folder when i has been modified last.
So, can any one suggest what is the command that i have to give so that it picks only that folder and prints the same into my text file.
Below is the content of my batch file :
S:
cd S:\log\logit-esb\dhl\subscriptions
dir >> D:\Abhi_Work\System_Monitoring\System_monitoring.txt
When I run the batch file below is the output directed to my text file.
Directory of S:\log\logit-esb\dhl\subscriptions
05/01/2015 04:25 PM <DIR> .
05/01/2015 04:25 PM <DIR> ..
05/01/2015 04:25 PM <DIR> processed
0 File(s) 0 bytes
3 Dir(s) 4,682,932,224 bytes free
Volume in drive S is System
Volume Serial Number is 42A7-D3B7
My requirement is i want only the below line to be displayed in the output file
05/01/2015 04:25 PM <DIR> processed
SO anyone help me in achieving this.
findstr
is probably easier than usingfor /f
...