   [win32] Changing the creation/modif time of a file
  Hi, I would like to batch process a bunch of files and change the modification and access times on them. I found programs that do that but they don't allow you to change time only but require you to change the date as well. I'm organizing my photos and for some reason the time on my camera got messed up. So my photos came out with wrong dates/times on them. Lightroom only categorizes photos by date so I need to redate a bunch of files at once. Can someone point me in the right direction (which functions do I use). I tried SetFileAttributes but it doesn't set the things I need. Thanks.   
SetFileTime [smile]   ;Quote:Original post by CodekaSetFileTime [smile]wow, I can't believe it's that simple, thanks Codeka!   ;  After coding for half an hour I realized that SetFileTime sets both date and time at the same time (duh). Is there any way I can set only one of them at a time? Meaning that I leave the other one unaltered, thanks.   ;Quote:Original post by VanillaSnake21After coding for half an hour I realized that SetFileTime sets both date and time at the same time (duh). Is there any way I can set only one of them at a time? Meaning that I leave the other one unaltered, thanks.Take a look at how FileTimes work. They are not like clock times. They correlate to a specific date.If you want to keep the same date, you will have to use a combination of functions such as: SystemTimeToFileTime or FileTimeToSystemTime.I would propose getting the current time of the file when you open it via GetFileTime. Next use FileTimeToSystemTime to get a readable format. Modify the time in that SYSTEMTIME structure to match the time you want. Finally use that new system time object and pass it to SetFileTime to keep the date yet have a new time.I believe something like that should work out well!   