Results 1 to 4 of 4

Thread: [RESOLVED]process.start and process.waitforexit

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2013
    Posts
    43

    [RESOLVED]process.start and process.waitforexit

    this is probably pretty simple but i'm not seeing it. i'm doing the following

    Code:
     Process.Start("C:\Program Files\7-Zip\7z", "x" & " " & G.StagingDirectory & " " & "-o" & G.StagingDirectory)
                'goes through directory and deletes the .mdoc files after they have been extracted
                Dim filecount As Integer = 0
                For Each filename As String In IO.Directory.GetFiles(G.StagingDirectory, "*.mdoc")
                    IO.File.Delete(filename)
                    filecount = filecount + 1
                Next
    the problem is it deletes the files before they can be extracted. i tried to use system.threading.thread.sleep(lots o seconds)


    how can i make the program wait for the process to finish?

    as always any help is welcomed.
    Last edited by bsanders; Apr 25th, 2013 at 10:04 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width