Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Command to display only the latest modified directory within another directory and display the date of the last modify

$
0
0

Okay I want to be able to run a .cmd file from my workstation to query a certain folder on remote clients. I want the command to find the specific folder within another folder and display the current date modified of that folder. I was able to use a command prompt to list the subdirectory that I was looking for on a specific computer by using theDIR command. It was something like this:

dir C:\ParentFolder\ChildFolder /ad /o-d /b

This shows a list of directories within the "ChildFolder" directory. The output would be something like:

dir C:\ParentFolder\ChildFolder /ad /o-d /b
folder1
folder2
folder3
folder4

So what I need now is a way to just show the folder in this group that had the most recent modification. For example if "folder2" was the most recently modified folder in the group, I would like my command line to just display "folder2 04/08/14 04:13 PM

Any help would be greatly appreciated.

Cheers!



Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>