Greetings.... and I ask forgiveness if this question has been posed before.... I have looked but not found all the answers I'm seeking.
Basically, I've got a video recording program that generates rather large files. I need to move those files to an external share, but I also need to categorize them by day and group them by hour. I could be generating upwards of 100 files per day, but they'll all have unique filenames, so that's not an issue. I just need a macro set up to act as a watch folder to take the file, determine it's destination directory by the day and time the file was created, and ship the file there.
Another question I have... if I schedule the watcher to start every 10 minutes or so, will it act upon files that are only partially created? These recordings will be somewhat large.
So if I start a recording at 4:30am that runs for 10 minutes... then I start another one 2 minutes later that runs for 7 minutes, then another one 2 minutes or so after that which runs for 12 minutes, can I start a watcher that runs often but only enacts on complete files?
This is becoming a beast of a project as I think about it. Any help or suggestions in putting this together would be welcomed with open arms. Thanks!
Move files based on date/time created
Re: Move files based on date/time created
FileMove wouldn't move a file if it's being locked by recording software, so there is no problem with that.
- AlphaBravo
- Posts: 586
- Joined: 29 Sep 2013, 22:59
Re: Move files based on date/time created
here is something to fiddle with
Code: Select all
SrcFolder := A_Desktop
DestFolder := "c:\"
SetTimer, Timer, 10000 ; 10 second timer
return
Timer:
Loop, Files, % SrcFolder "\*.avi" ; assuming avi files type
{
file := A_LoopFileFullPath ; save file full path
SubFolder := DestFolder "\" SubStr(A_LoopFileTimeModified, 5,6) ; subfolder named after month day and hour mmddhh
if !InStr(FileExist(SubFolder), "D") ; if folder does not exist
FileCreateDir, % SubFolder ; create folder
FileMove, % file , % SubFolder "\" *.* ; move file to destination
}
Who is online
Users browsing this forum: No registered users and 93 guests