How to determine/ignore which file stops COPYFILE.

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
FayeMar01
Newbie
Posts: 11
Joined: Sat Sep 13, 2008 5:57 am

How to determine/ignore which file stops COPYFILE.

Post by FayeMar01 » Wed Jan 20, 2010 7:57 am

I am copying a folder from one server to another.

I am pretty sure that a locked file is causing the COPYFILE to end.

How do I determine the file and/or ignore the lock?

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Jan 20, 2010 9:19 am

Instead of copying the entire folder, you could use GetFileList and loop through each file in the folder, copying one at a time. Then if one fails, the others will still copy, as you are copying them separately.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Wed Jan 20, 2010 9:53 pm

If you need to copy many files and can skip locked files, you might try Unstoppable Copier from here: http://www.roadkil.net/download.php?Fil ... ogramID=29
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

FayeMar01
Newbie
Posts: 11
Joined: Sat Sep 13, 2008 5:57 am

Post by FayeMar01 » Thu Jan 21, 2010 12:12 am

"Instead of copying the entire folder, you could use GetFileList and loop through each file in the folder, copying one at a time. Then if one fails, the others will still copy, as you are copying them separately."

OK - perhaps I was loose in specifics.

I am doing a "...\Apps\*.*" type copy with many sub-folders. I don't think GetFileList would work?

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Thu Jan 21, 2010 12:33 am

You could output TREE to a file, use RegEx to parse it to get the full path\filenames, and write that to a file and read through the list, doing a CopyFile on each one. Test for CopyFile success after each Copy using IfFileExists on destination folder.

.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts