Solved

FSO CopyFolder  in VB 6 -- how to know when it's finished?

Posted on 2004-04-28
2
1,076 Views
Last Modified: 2012-05-04
Please could an expert suggest the best way to detect in VB6 when FSO CopyFolder has finished copying.

When the folder has much content the process can take enough time to permit an unintended user intervention.

Will be appreciated

Gordon
0
Comment
Question by:Gordon_Atherley
2 Comments
 
LVL 76

Assisted Solution

by:David Lee
David Lee earned 125 total points
Comment Utility
In my experience FSO.CopyFolder is finished when it moves on to the next command.  Consider this code sample:

    Dim fso As New FileSystemObject
    Label1.Caption = "Running"
    DoEvents
    fso.CopyFolder "C:\Source", "C:\Destination\", True
    DoEvents
    Label1.Caption = "Finished"

When I run this the label stays at running until the CopyFolder process is actually finished and moves on to change the label to "Finished".  
0
 
LVL 3

Accepted Solution

by:
Level10Access earned 125 total points
Comment Utility
Using FSO, the script will only move to the next line after the copyfolder process is either completed or errored out.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now