Sign in to follow this  
Followers 0
Diana (Cda)

Can AI know when a dircopy has finished?

3 posts in this topic

I just realized why a folder copy is failing somewhat. There isn't always enough time for the copy to finish. Is there a way for AI to determine when a particular dir copy has finished so that I can then continue the script after that point? The basic operation is:

$sourceFolder = @UserProfileDir & "\Start Menu"
$destinationFolder = @ScriptDir & "\BKPfldr- StartMenu"
DirCopy($sourceFolder, $destinationFolder, 8)

I'm trying to do a folder rename, which should only happen after the file contents have been copied completely. If there is any slowdown in system and sleep finishes and folder gets renamed, it cuts into the copying process so resulting folder backup is incomplete. Did a search and looked through help file, as usual, but can't find term to use.

Thx. :P

Share this post


Link to post
Share on other sites



I'm not certain, but the copy should exist as a process, would a processexist wait work?


Giggity

Share this post


Link to post
Share on other sites

DirCopy doesn't return until completion. You need to check for @ERROR because it sounds like its failing.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0