I have revised the command to make the default behavior only update the modified date and added a new flag to optionally update the created time.
The previous build also had an issue where it was applying the operation recursively even when when the -r flag was omitted.
/setfolderdate [-rc] <path>
This local command can be used to set the modified date of a folder to the newest item within the folder.
The
r flag can be used to perform the operation on <path> and recursively to all sub-folders within <path>
The
c flag will update the creation date to the oldest item within the folder.