Visual Basic Waiting for Processes code help.

So here I am, working on a software release, to extract SRCDS content, such as HL2, EP1, and Ep2, as well as other server types, all fine and dandy, but there is one thing stopping me from releasing a public beta, some waiting code. Link to the actual WIP thread is here:

Currently I need help with one snippet of code that will be implemented into the rest of the program to sequentially extract files, rather than all-at-once.

This is the base code that will be implemented throughout parts of the program, thus far, this raw code, will be updated as I continue to try figuring it out. Best of thanks to all those who can assist me. Links also work just fine, I’ve seen some complex implementations, but all that I need to do is fairly simple, just wait for the process to end, before looping back to rerun the code through the indexes of the array. Then go onto the next GCF for extraction, repeating the procedure, I will be sure to optimize it fully for the whole program once I get this base code figured out. Again, many thanks for help.

This is the old code I have worked with and created, it works just fine, but the shere appearance of it, and lack there-of optimization, makes me want to make the array loops in the first place.

** This is the error that I get when I run the actual extraction test: It could honestly be as simple as the way im passing the parameters to HLEXTRACT, but I need some actual outside help to figure out what it is.

Your question would be better off in the Programming section.

But now on-topic. After browsing the documentations a bit, I believe I found your problem. ProcessStartInfo with one argument assumes it only receives the file name to run. What you want to do is call it with two strings, first for the program file name only, second with all the parameters.

I saw that before, I can try it once more, to see if it works, maybe im just being stupid with how Im approaching this.

When I told it to messagebox a debug output of what ExtractProcess and ExtractProcessInfo to strings said, it gave me this,

I’ll try this once more, to see if I was just being stupid. Thank you for the help if it works, if not, thank you still.


OM YES ITS WORKING! all I needed was to modify it to do this: Some quotes and a comma.
Dim ExtractProcessinfo As New ProcessStartInfo(“cmd.exe”, "/C HLEXTRACT.exe -p " to get it to work.

You can actually cut off the ProcessStartInfo middle-man and just call Process.Start with the two strings, file name and arguments.

[editline]2nd January 2011[/editline]

Automerge :arghfist::saddowns:

Could I get an example of this, I get what you’re saying, but I cant seem to figure out how to put it into code.

Try this too, you probably don’t need to use cmd.exe.

[csharp]ExtractProcess = Process.Start(“HLEXTRACT.exe”, “-p and whatever else arguments you need”)[/csharp]

[editline]2nd January 2011[/editline]

Stop breaking my automerge! :byodood:

This is what it comes out to now, just to optimize it for the rest of the code, but thank you so much.

What exactly is automerge, I’ve heard the term so many times but never once thought to ask till now.

If you post two posts in a row, it merges them into one.

When you post multiple times without other people posting in between, your posts get merged into one post. It will add a editline and add the new text in the old post. As demonstrated below.

[editline]2nd January 2011[/editline]

Only works for an hour :ninja:

Lol, thanks you two. Also, the entire HL2 Section of the extractor is almost done being coded, after that, just Ep1 and Ep2.

I should hope that HLEXTRACT and HLLib dont get outdated, because it would invalidate the whole function of my program. What’s nice is, if it does get updates, all that needs to be updated is the HLEXTRACT and HLLib parts of the program, not the SRCDSManager itself.