in reply to Run the process in the background

If you're in Windows and "cmd" expects a list of hosts as arguments, "&" would be treated as a host name since "&" doesn't mean anything to the Windows shell. Understandably, "cmd" can't connect to host "&".

system("start cmd") is Windows's equivalent to unix's system("cmd &").

Replies are listed 'Best First'.
Re^2: Run the process in the background
by saberworks (Curate) on Aug 31, 2005 at 15:41 UTC
    I think when he said "cmd" he meant something like $cmd which contains the command. I don't think this question has anything to do with windows, he probably should have said, system('my_long_command_here &') or something.

      I know. I never assumed he was refering to cmd.exe. (I assumed the opposite, since cmd.exe doesn't accept host names are arguments.) I described the most likely scenario given the lack of details posted by the OP, and the solution for that problem.