In php I can change the file last modification and access time arbitrarily with touch()
<?php
touch($filename,mktime(0,0,0,2010,1,10));
...but how to change the creation time?
Why do I need this? Well, If I retrodate a file or a directory mtime to before their creation date, explorer.exe
keeps showing me the more recent creation date instead.
Mh, an unsatisfactory, but working, approach I found out about, is: using nircmd.
Nircmd is a 37kb utility. (redistributable, closed-source, freeware)
How to proceed:
<?php
$time=strftime('%d-%m-%Y %H:%M:%S',$time);
$cmd=".\\nircmdc.exe setfilefoldertime \"$filename\" \"$time\"";
system($cmd);
Notes:
c
before .exe
)Still, I hope there is a COM or WMIC solution I couldn't find this time around.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With