Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you're just talking about retrieving each file from a different location, but still doing it sequentially, you just change the URI in the <code>wget</code> command to point to a different location.</p> <p>If you want concurrent downloads rather than sequential, you would have to start three <em>separate</em> processes and have them download one file each. These ptocesses could run side by side but I'd probably only consider this for large files (of which an XML file is probably not).</p> <p>If you're having troubles getting the commands to run at all, the first thing I would do is ditch <code>cmd.exe</code> and its standard input. There's no reason why you can't have a process run <code>wget</code> directly. Or, if you really only want to start the one process, you could output them to a temporary file and use a single process <code>cmd /c tempfile.cmd</code> to run it.</p> <hr> <p>However, there may be a totally <em>different</em> problem you're having unrelated to what you've shown, because that exact code with three <code>echo</code> statements in place of your <code>wget</code> ones runs fine, generating the correct output, at least in Visual C# Express 2010.</p> <p>And, in fact, once I got my GnuWin32 <code>wget</code> on to the path, the following worked as well, getting real documents off the net and placing them in my top-level directory:</p> <pre><code>using System; using System.Diagnostics; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { ProcessStartInfo startInfo = new ProcessStartInfo("cmd.exe"); Process p = new Process(); startInfo.RedirectStandardInput = true; startInfo.UseShellExecute = false; startInfo.RedirectStandardOutput = true; startInfo.RedirectStandardError = true; p = Process.Start(startInfo); p.StandardInput.WriteLine( @"wget --output-document=c:\q1.txt http://www.ibm.com"); p.StandardInput.WriteLine( @"wget --output-document=c:\q2.txt http://www.microsoft.com"); p.StandardInput.WriteLine( @"wget --output-document=c:\q3.txt http://www.borland.com"); p.StandardInput.WriteLine(@"exit"); string output = p.StandardOutput.ReadToEnd(); string error = p.StandardError.ReadToEnd(); p.WaitForExit(); p.Close(); } } } </code></pre> <p>Here's the proof, the single window partway through the Microsoft download:</p> <p><img src="https://i.stack.imgur.com/GwIgm.jpg" alt="enter image description here"></p> <p>So, bottom line, what you have shown us is not inherently unworkable as evidenced by the image above. My only suggestion is to start looking around at other things such as the version of <code>wget</code> you're using, GnuWin32 or CygWin.</p> <hr> <p>Now, things get interesting with larger files, as you've stated in one of your comments. If I change all three URIs to <code>http://download.microsoft.com/download/5/F/C/5FC4F80C-242D-423B-9A11-9510A013152D/Dolphins.themepack</code>, a file of 12,889,103 bytes, the code above hangs at about 18% of the first download (around the 2.3M mark).</p> <p>However, if I change the commands so that they have <code>&gt;nul: 2&gt;nul:</code> on the end, the download goes through without issue, so I suspect it's most likely an issue with the way <code>wget</code> writes its output (without newlines). It also works fully if you don't use redirection on the output and error streams, which strengthens that assertion.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload