2

I need to start some process on winXP with "start" command. Sounds simple.

But is there a way that the started process would not inherit any ports from parent?

I start children in my program using:

system "start x -params"

Now when parent is being killed, I can't start it again because I'm learned by errors that some process is already occupying port (which killed parent was using).

I don't want to use:

  • createProcess (from winAPI, where this can be setup to not inherit fds)
  • use python in my start string (or any similar interpreters)

Is there a way to start my child process in a way I want them to start?

Is there any "start" alternative?

bua
  • 4,761
  • 1
  • 26
  • 32

2 Answers2

1

So after diggin a while, i've found:

psexec

with commandline like:

psexec -d -s myprogram > logfile.log 2>&1

everything is solved.

bua
  • 4,761
  • 1
  • 26
  • 32
  • 1
    Thanks very much for posting the answer, this solved a problem I had with spawning another process from Hudson. The problem is described at http://wiki.hudson-ci.org/display/HUDSON/Spawning+processes+from+build but that page does not suggest psexec. – EMP Mar 01 '11 at 02:13
0
powershell -command "Start-Process myprogram.exe"
Durai Amuthan.H
  • 31,670
  • 10
  • 160
  • 241
Denis
  • 123
  • 7