Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > Scripting > Script to copy files not in progress of being copied

Reply
Thread Tools Display Modes

Script to copy files not in progress of being copied

 
 
Lars
Guest
Posts: n/a

 
      08-27-2008
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

 
Reply With Quote
 
 
 
 
Pegasus \(MVP\)
Guest
Posts: n/a

 
      08-27-2008

"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.


 
Reply With Quote
 
Lars
Guest
Posts: n/a

 
      08-27-2008
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.
>


 
Reply With Quote
 
Pegasus \(MVP\)
Guest
Posts: n/a

 
      08-27-2008
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.
>>

>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
progress bar while file being copied dummster Scripting 0 05-03-2006 05:03 PM
Copy files with startup script Mike Farren Windows Server 1 04-05-2006 05:52 AM
File Copy with progress bar script Allan Tee Scripting 2 12-27-2005 11:58 PM
Script to copy files Eloir Carli Junior Scripting 11 02-02-2005 09:21 PM
Script to copy log files gubba Scripting 1 10-27-2003 03:10 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59