Page 1 of 1

New option for copy dialogue? (Set to current date/time)

Posted: 2014-09-05, 12:16 UTC
by damjang
Sometimes I need to copy a file, but update the creation date/time to now for new file. Now I copy the file and then go to Change attributes... and set the new date/time to Current.

So I ask here if can be possible to add a new option in copy dialogue to do this automatically?

Or it is possible to do this in other way?

Thank you

Posted: 2014-09-05, 13:54 UTC
by Stefan2
I think you can use a batch to copy the file and then
in the same batch utilize a tool like 'touch' to set the timestamp.

Such batch you can put on an button or assign an hotkey to it.

- - -

Or use PoSH, which will do all this at one.
TC can deliver the parameters like "%P%N" "%T%N"

Pseudo Code:
Cmd: powershell
Para: CopyAndStamp.ps1 "%P%N" "%T%N"


I have less experience with this "$args[0]" parameter "delivery" to a
powershell script, but I can try,....later the day.


 

Copy with PowerShell to other Target change touch timestamp

Posted: 2014-09-05, 14:08 UTC
by Stefan2
Never mind, I just did an short test...

Try this button

Copy selected file to target panel and set date and time to Now()

CMD: PowerShell
Para: Copy """%P%N""" """%T%N"""; (Dir """%T%N""").LastWriteTime = Get-Date
[X] Run minimized


From:
C:\Temp\File name.ext 01.04.2012 08:48   [face=timesnewroman](ex. origin date)[/face]
TO:
X:\Back\File name.ext 05.09.2014 15:08   [face=timesnewroman](current date)[/face]


- - -

BTW:
I just test some more usage...

Create a copy of selected with "_bak" inserted in same folder:

Para: Copy """%P%N""" """%P%O_bak.%E"""; (Dir """%P%O_bak.%E""").LastWriteTime = Get-Date
[X] Run minimized

From:
C:\Temp\File name.ext 01.04.2012 08:48   [face=timesnewroman](ex. origin date)[/face]
TO:
C:\Temp\File name_bak.ext 05.09.2014 15:08   [face=timesnewroman](current date)[/face]



- - -

Touch selected file with current timestamp:

CMD: PowerShell
Para: (Dir """%P%N""").LastWriteTime = Get-Date
[X] Run minimized

From:
C:\Temp\File name.ext 01.04.2012 08:48 [face=timesnewroman](ex. origin date)[/face]
TO:
C:\Temp\File name.ext 05.09.2014 15:08 [face=timesnewroman](current date)[/face]