Sign in to follow this  
Followers 0
Batch

FileCopy doesn't wait?

5 posts in this topic

I'm trying to help a buddy do a script that copies a big .pst from a DVD over to a dir on the hard drive, and after the copy is completed open outlook and map that .pst file.

It appears that neither FileCopy nor DirCopy wait until they are through doing their job before the rest of the script completes. While the .pst is still copying, outlook opens, and a .pst gets mapped that doesn't exist. I know we could always RunWait( "cmd /c copy f:\mail\*.pst c:\mail" ) and be done, but I just figure I'm missing something for the built in command not to be working.

Can you guys point me in the right direction? TIA

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I'm trying to help a buddy do a script that copies a big .pst from a DVD over to a dir on the hard drive, and after the copy is completed open outlook and map that .pst file.

It appears that neither FileCopy nor DirCopy wait until they are through doing their job before the rest of the script completes. While the .pst is still copying, outlook opens, and a .pst gets mapped that doesn't exist. I know we could always RunWait( "cmd /c copy f:\mail\*.pst c:\mail" ) and be done, but I just figure I'm missing something for the built in command not to be working.

Can you guys point me in the right direction? TIA

what about a do/while loop based on File size

Filecopy("d:\source\outlook.pst","c:\target\outlook.pst")
While 1 
   Sleep(10)
   if Filegetsize("d:\outlook.pst") <> Filegetsize("c:\target\outlook.pst")then 
      ExitLoop
   Endif
Wend
Edited by blademonkey

---"Educate the Mind, Make Savage the Body" -Mao Tse Tung

Share this post


Link to post
Share on other sites

That's a great idea! Thanks for your reply, although I expect you mean if Filegetsize is EQUAL to, and not NOT EQUAL, otherwise it would exitloop immediately, right? Is that an acknowledgement that neither of these functions are supposed to wait? It seems like that should be a parameter option.

what about a do/while loop based on File size

Filecopy("d:\source\outlook.pst","c:\target\outlook.pst")
While 1 
   Sleep(10)
   if Filegetsize("d:\outlook.pst") <> Filegetsize("c:\target\outlook.pst")then 
      ExitLoop
   Endif
Wend

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

That's a great idea! Thanks for your reply, although I expect you mean if Filegetsize is EQUAL to, and not NOT EQUAL, otherwise it would exitloop immediately, right? Is that an acknowledgement that neither of these functions are supposed to wait? It seems like that should be a parameter option.

I used this in 3.1.1 and the beta. Both times the script pauses for the FileCopy event to finish.

FileCopy('VTS_01_3.VOB', 'VTS_01_31.VOB')
MsgBox(0, '', 'done', 1)

Time, nearly 2 mins to complete.

>Exit code: 0 Time: 116.450

As you show no code to support your issue, then it is unknown what your problem may be. Edited by MHz

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