moving a file - file in use

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
howl
Junior Coder
Posts: 24
Joined: Tue May 29, 2007 6:41 pm

moving a file - file in use

Post by howl » Wed Apr 22, 2015 3:48 pm

I have a script that's moving files. Occasionally the file being moved is in use and the move doesn't happen. How can I monitor for an "in use" error so I can deal with these exceptions?

Thanks

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

Re: moving a file - file in use

Post by Marcus Tettmar » Wed Apr 22, 2015 6:25 pm

You should be able to trap the error - ignore errors and then check lasterror:

https://www.mjtnet.com/manual/index.htm ... ndling.htm
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

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