Perhaps a copy process with an inbuilt "wait" function would do the trick:
sSourceName = "d:\temp"
sTargetName = "c:\"
iDelay = 5 'Minutes
Set objFSO = CreateObject("Scripting.FileSystemObject")
For Each oFile In objFSO.GetFolder(sSourceName).Files
If DateDiff("n", oFile.DateLastModified, Now) > iDelay Then
oFile.Copy sTargetName
End If
Next
"Lars" <> wrote in message
news:...
> Thanx for you answer Pegasus,
>
> We have a scanner that creates a PDF in an Incoming folder.
> A script runs in the Incoming folder that splits multipage PDF files
> to multiple files in an Outgoing folder and deletes the original file in
> the Incoming folder. This works great until thereīs a file in progress
> being copied/created in the Incoming folder. To avoid these problems
> Iīm gonna copy the files in the Incoming folder to a Working folder and
> run the script in thata folder instead. I just need the copy to exclude
> any files being transfered by the scanner.
>
> Regards Lars
> "Pegasus (MVP)" <> wrote in message
> news:...
>>
>> "Lars" <> wrote in message
>> news:...
>>> Hi,
>>> I have a batchfile that copies files in a directory to another
>>> directory.
>>> Files are being copied to the source directory and I donīt want the copy
>>> to include files in progress of being copied. How do I do this?
>>>
>>> Regards Lars
>>
>> Depending on the method used for copying, files that are
>> being copied will be locked and won't be touched by the
>> second copy process.
>>
>> It might help if you were a little more specific and gave
>> full details about the two concurrent copy processes.
>>
>
|