Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

TOUCH a directory?

On 2008-11-28 15:27, Stefano Piccardi wrote:

> Does anyone know how to change the creation and last access dates of a directory? TOUCH does not support directories. Thanks.

The TOUCH help says:

"By default, TOUCH affects only files. You must utilize the /A: option to include directories. /A:D will select directories only."
 
Stefano Piccardi wrote:
| Does anyone know how to change the creation and last access dates of
| a directory? TOUCH does not support directories. Thanks.

The method was mentioned by others. However, changing the "last accessed"
date of a directory is almost always a wasted effort. Almost any action
relating to a directory updates its access date.
--
Steve
 
Thank you both for your replies.
I had to fight TCC a bit to find a way to touch a directory tree without touching its files. The trick is that it seems TOUCH /A: works only when the directory name is "." at least for me. Any other full or relative directory path triggers an error. So, given %root%, the path of the tree root directory,
pushd
cdd /n "%root%"
global /q touch /a: /q /tw08:15 .
popd
resets the write time of root and all its sub-directories to 8:15.
 

Similar threads

Replies
6
Views
3K
Replies
2
Views
2K
Back
Top