Question:
I would like to know how to receive the name of the file that was last modified through a DOS command.?
2008-12-29 03:02:42 UTC
Hello all,
I would like to know how to recieve the name of the file that was last modified through a DOS command. Let's say I have this case:
c:\folder\textfile-05.txt
c:\folder\textfile-12.txt
c:\folder\textfile-03.txt
c:\folder\textfile-43.txt

The number does not have anything to do with the modification date.
Anyway, let's say that in this example, the file at hand is 'textfile-03.txt'. What command do I write in order to get a result of 1 line i.e. 1 file that meats this criteria I am looking for...? The output should of course contain the file's name.
I would like to redirect the command's output to a file on the system. How do I do this, if the file&folder exists or not ...?

Thank-you.
Three answers:
ELfaGeek
2008-12-29 03:36:44 UTC
It's DOS, and I can't even remember how, or if it's even possible.



DOS is dead!



But, if you must, here's a link that may help:
Batmunkh
2008-12-29 03:15:21 UTC
Just click upper arrow. it will display previous commands you have executed.
2008-12-29 03:06:43 UTC
dir /OD



dir /OD > somefile.txt



dir /? for more info


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...