Batch Posted January 10, 2006 Share Posted January 10, 2006 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 Link to comment Share on other sites More sharing options...
blademonkey Posted January 10, 2006 Share Posted January 10, 2006 (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? TIAwhat 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 January 10, 2006 by blademonkey ---"Educate the Mind, Make Savage the Body" -Mao Tse Tung Link to comment Share on other sites More sharing options...
Batch Posted January 10, 2006 Author Share Posted January 10, 2006 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 Link to comment Share on other sites More sharing options...
MHz Posted January 10, 2006 Share Posted January 10, 2006 (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 January 10, 2006 by MHz Link to comment Share on other sites More sharing options...
trids Posted January 10, 2006 Share Posted January 10, 2006 Until we get a FlushCache command ( ) .. you can use this little tool from sysinternals:http://www.sysinternals.com/utilities/sync.htmlHTH Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now