There is a touch utility in Windows-10 that can be launched from the command line. She can change the date and time for files.

We need the same utility (also run from the command line), which can change the date and time for folders (directories).

Tell me where to dig. Do not write the very same utility.

[Why change the date of creation] I explain. A block of file directories is created in the batch file, then this block is zipped and sent to the customer. It is necessary that all files and all directories in a zip be the same date and time for a given zip. So the customer can distinguish between versions and delivery dates of versions (in addition to the actual version number).

  • Comments are not intended for extended discussion; conversation moved to chat . - JuriySPb

1 answer 1

So the solution already exists: touch (batch)

Accordingly, the first command is enough:

forfiles /pc:\Directory /s /m * /c "cmd /c @copy @path /B+ ,,/Y" 

The lack of a command manifests itself with a large number of files (several thousand) and slow system operation - the discrepancy in time of file changes can take up to several seconds. The main minus - the attributes of directories are not processed. But these are trifles and are “finished”, for example, with the following command:

 powershell -command Write-Output "(Get-ChildItem -Path C:\Directory -Recurse -Force -ErrorAction SilentlyContinue| ?{ $_.PSIsContainer }) | Foreach {$_.LastWriteTime=(get-Date '16.12.2014 00:00')}"