Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8698845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:48:45+00:00 2026-06-13T01:48:45+00:00

The following codes is moving a file as long as the file doesn’t already

  • 0

The following codes is moving a file as long as the file doesn’t already exist. If it does, it won’t move the file.

My question is regarding the File.Move. When will the msgbox display? Will it display once the file is completely moved or will it display right after the File.Move line is executed.

Depending on the file size, it may take awhile to move the file and thus I don’t want the msgbox to display until the file is moved completely.

Is there a better way of doing this?

        For Each foundFile As String In My.Computer.FileSystem.GetFiles("C:\Temp\", FileIO.SearchOption.SearchAllSubDirectories, "*.zip")
            Dim foundFileInfo As New System.IO.FileInfo(foundFile)

            If My.Computer.FileSystem.FileExists("C:\Transfer\" & foundFileInfo.Name) Then
                Msgbox("File already exists and will not moved!")
                Exit Sub
            Else
                File.Move(foundFile, "C:\Transfer\" & foundFileInfo.Name)
                Msgbox("File has been moved!")
            End If
        Next
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T01:48:46+00:00Added an answer on June 13, 2026 at 1:48 am

    Accordingly to this source, the File.Movecall is synchronous, which means that your msgbox will be shown only after the file is moved, regardless of its size.

    For completeness, if you don’t want to block the UI, you can try something like this:

    ' This must be placed outside your sub/function
    Delegate Sub MoveDelegate(iSrc As String, iDest As String)
    
    ' This line and the following go inside your sub/function
    Dim f As MoveDelegate = AddressOf File.Move
    
    ' Call File.Move asynchronously
    f.BeginInvoke(
        foundFile, 
        "C:\Transfer\" & foundFile, 
        New AsyncCallback(Sub(r As IAsyncResult)
                              ' this code is executed when the move is complete
                              MsgBox("File has been moved!")
                          End Sub), Nothing)
    

    or you can explore the new async / await instructions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have following code for moving 4 picture around circular way,but it can rotate
I've created my own code for moving windows around, using the following system: mousedown
Given the following xml: <language>en-US</language> <provider>VenturesLLC</provider> <video> <original_spoken_locale>en-US</original_spoken_locale> <vendor_offer_code>TEST_VENDOR</vendor_offer_code> <release_date>2011-01-15</release_date> <title>Moving Forward</title> <vendor_id>ASDF_ING_2012</vendor_id> </video>
I have the following codes <div class=row-fluid> <div class=span6><img src = <?php echo $photo
I have used the following codes: bar([c f], 0.1,'stacked'); and bar( [c , f
I am trying the following codes to suffle the elements of an ArrayList -
I have this following codes: @implementation MyImageView @synthesize image; //image is a UIImage -
i have the following codes in SQL XML . I need to insert a
Please Check the following codes & please tell me about the error(s) I have
I am using the following codes, to replace a JLabel each 0.5 seconds, with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.