TOUCH a directory?

May 31, 2008
382
2
Does anyone know how to change the creation and last access dates of a directory? TOUCH does not support directories. Thanks.
 

dim

Dimitry Andric
May 31, 2008
205
1
Netherlands
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."
 
May 20, 2008
3,515
4
Elkridge, MD, USA
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
 
May 31, 2008
382
2
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
Thread starter Title Forum Replies Date
C Touch command — I Need to touch matching files in another directory. Support 5
vefatica Error message from TOUCH Support 2
Dick Johnson Touch command is off by 1 hour Support 10
Dick Johnson Question about the Touch command Support 0
fpefpe Documentation touch and /r Support 1
fpefpe Documentation touch Support 6
fpefpe touch - date format Support 2
Frank Abel Cancio Bello How to? specified milliseconds with the touch command? Support 0
fpefpe Documentation Touch Support 2
nickles WAD touch with reference file Support 5
vefatica WAD TOUCH /R[acw]? Support 8
JohnQSmith Help file for TOUCH Support 0
MikeBaas TOUCH (V13.04.55) Support 3
J touch Support 3
H touch sensitive to order of options Support 2
C touch /c one;two creates only two Support 3
wadeb question about touch /s Support 2
E TOUCH and DST Support 3
Stefano Piccardi TOUCH question Support 3
fishman@panix.com HELP!! I just updated to Version 28 and as usual I cannot make extended directory search work. Support 2
D How to use multi-line DO to loop through first level directory names Support 5
D ParentDirectory does not update directory history Support 6
samintz CDD to non-existent directory hangs Support 2
gworley rd (Remove Directory) gives interesting error: Support 2
D Directory History Window with wildcard search Support 3
D How to? Skip removing directory (RMDIR) without error message Support 2
gentzel Directory stack empty when running TCEXIT? Support 9
vefatica Disable extended directory searches (completely)? Support 8
M WAD "Pictures" directory is empty in TCC but not in CMD or Explorer Support 4
G Local Directory Corruption Support 11
Jay Sage Directory Alias Access to FTP Servers Support 2
Joe Caverly DIRectory Colorization in v25 Help File Support 0
K copy changing destination current directory Support 1
thorntonpg option /u not working The directory name is invalid Support 5
J built in file explorer - how do i go back "up" the directory? Support 2
vefatica Extended directory searches? Support 6
Joe Caverly Using a Directory Alias with @iniwrite fails Support 14
A Installer /extract: extracts into current directory if target not exists Support 12
Charles Dye Ctrl-Shift-Up doesn't update directory history Support 1
G Extended directory search not working Support 4
CWBillow Editing in the root directory of windows 10 Support 6
D Directory stack empty Support 1
J directory or folder to start in Support 2
M How to unlock a directory Support 1
Alpengreis Fixed TCMD FileExplorer Start-Directory problem Support 4
R V19 - At startup, TCC save directory in the directory history list Support 2
nickles Move takecommand.18.0.key location to installation directory Support 4
fishman@panix.com Extended Directory Searches are not working for me in CDD Support 9
vefatica TCMD's current directory? Support 4
J How to set working directory Support 10

Similar threads