I was wondering if its possible to watch a folder and move the files each time there modifed so it would have to be running all the time. I am still very new to all this and any help would be apreciated before i start wasting time on somthing thats not even possible.

many thanks

will rose

9 Years
Discussion Span
Last Post by Teme64

thanks for that it has def pointed me in the right direction i have got it to copy the file once it has been updated but it trys to do it twice here is my code

Dim FileGoto As String

FileGoto = "c:\watch\"

If e.ChangeType = IO.WatcherChangeTypes.Changed Then

System.IO.File.Copy(e.FullPath, FileGoto & e.Name)

End If

i think i am just missing somthing stupid :-P


Off the top of my head, with no testing done, I think it tries to do it more than once because there are different types of changes occuring in the file being watched... e.g Changes to its attributes, to its size, to the LastWriteTime and so on. When a file is written to, the size changes as well as the LastWriteTime and each of these changes causes the program to try to copy the file.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.