Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27154

VS 2010 [RESOLVED]process.start and process.waitforexit

$
0
0
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.

Viewing all articles
Browse latest Browse all 27154

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>