Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there any way, under Windows 7, to emulate the behaviour of the & character in OS X's Terminal?
I'm trying to run multiple Wget instances simultaneously: I can do this without any problem of sort under OS X, because I have a Python script which builds a long string, in which each instance of Wget is &-separated. When I execute it with os.system() everything goes fine.
Under Windows, though, this doesn't work, and the instances are run in sequence. Which is not what I want.
I'm open to all suggestions: cmd.exe hacks, shell ports, more Python, anything, as long as new windows shell windows are created. Thanks in advance!

Edit: I've found out that files are in fact downloaded using this method, but under Windows, cmd.exe just ends abruptly the execution, and lets the user accept new commands. Is there any way to avoid this, and keep the console "hanging" until all Wget instances have finished downloading?

Edit 2: posting the code I'm using.

for track in album.tracks():
    tracknum = track["track_num"]
    tracktit = track["title"]
    URL = track["file"]["mp3-128"]
    filename = str(tracknum) + " - " + tracktit + ".mp3"

Now, under OS X, this code work wonderfully.

    execstr += 'bandcamp-support' +os.sep+ 'wget --tries=0 -O"{}" "{}" -q & '.format(filename,URL)
    os.system('bandcamp-support' +os.sep+ 'wget' execstr[:-3])

Under Windows, instead, this doesn't replicate the behaviour that I experience on OS X.

    os.system('start /B bandcamp-support' +os.sep+ 'wget --tries=0 -q -O"{}" "{}"'.format(filename,URL))
share|improve this question
it didnt work? What exactly did you type? – Keltari Aug 7 '13 at 16:14
This is the command I use for each instance of Wget: os.system('start /B bandcamp-support' +os.sep+ 'wget --tries=0 -q -O"{}" "{}"'.format(filename,URL)) @Keltari – Jetlef Aug 7 '13 at 16:17
I don't know for sure if it does this (because I don't really use the Windows command-line), but you should consider using powershell rather than cmd.exe, since it has more features in general. – evilsoup Aug 7 '13 at 16:32… indicates it's easy to start multiple processes with and only hard to interact with more than one concurrently. and v (but not other variants) is stated to also provide an 'older' way to run processes NOWAIT on both Unix and Windows – dave_thompson_085 Nov 23 '15 at 4:33

If you are a fan of *NIX shells, you can install Cygwin and have access to all those shells and tools with Cygwin. Ot you can just install a Bash shell with Win-Bash. However, I think you would be better off with Cygwin, as it has a lot of functionality.

share|improve this answer
Cygwin is interesting, but it requires a lot of DLLs... isn't there a single binary file out there? Or a way to pack it into a binary myself? Now I know why all programmers use Linux/OS X... and why everyone hates Windows. :D – Jetlef Aug 7 '13 at 16:36
I highly recommend Cygwin, worst case you can uninstall it. Its stable and you can get all the *NIX tools you can ever want. Wget isnt part of the base package, you can search for it (get the one under web tools, which is the full application, not the Perl based implementation). – Keltari Aug 7 '13 at 16:48
Ah, I give up. Windows' scared another one away. I guess what I want to do can be somehow accomplished using these techniques: Wait the end of subprocesses with multiple parallel jobs, but I'd need to adapt those examples to Windows, and I'm just tired of doing this. – Jetlef Aug 7 '13 at 17:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .