Dos Script for Directory Timestamps

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
samuk
Posts: 2
Joined: 27 Jul 2011 04:15

Dos Script for Directory Timestamps

#1 Post by samuk » 27 Jul 2011 04:24

Hi everyone,

I hope someone can help me with this. I am trying to monitor some folders on my file server for changes.
I am trying to get a folder names with timestamp of when contents of the directory where last changed. I have managed to get some of it to work by using for example

dir D:\<foldername>\/T:C /T:W >> C:\<filename>

Which works great it provides an output, but what is strange is that the folders contained for example in

D:\<foldername> have a new timestamp where as the root folder does not reflect a change in timestamp.

So for example D:\folderA has a timestamp of 01/19/2011 but when I go into FolderA to check the timestamp of a subfolder I get a much more recent timestamp of 07/27/2011

I am hoping someone can provide some help with getting a time stamp without getting the details of the subfolders.

Thanks
Samantha

trebor68
Posts: 146
Joined: 01 Jul 2011 08:47

Re: Dos Script for Directory Timestamps

#2 Post by trebor68 » 27 Jul 2011 05:48

In the Example are two option of "/t". Only the last option will used the DIR command.

option "/t:c" for timestamp "create"
option "/t:a" for timestamp "last access"
option "/t:w" for timestamp "last writing"

When using the option "/t" also add the option "/o:d".

Code: Select all

dir C:\Test\ /a:d /o:d /t:w

List only all subfolders in the folder "C:\Test" in the order of creating this folders.

samuk
Posts: 2
Joined: 27 Jul 2011 04:15

Re: Dos Script for Directory Timestamps

#3 Post by samuk » 27 Jul 2011 09:03

Hi thanks for the suggestion

Post Reply