How-to Run Shell Program in Background

Discussion in 'Windows XP Help and Support' started by rlsj, Sep 2, 2013.

  1. rlsj

    rlsj

    Joined:
    Aug 22, 2013
    Messages:
    5
    Likes Received:
    0
    Is there a capability in the Windows-XP shell (command line interface) equivalent to the Linux (UNIX) shell capability of the "&" key? That is, which lets you start a command as a separate process to run in background while you go on with other commands?

    I want to invoke a command line program automatically at startup that can keep running in background long after Windows finishes booting. It will assign itself a socket and behave as a Linux daemon. Putting its shortcut in the startup folder results in it starting -- I see the Cmd window flash on the screen -- and immediately terminating

    Thanks for your attention.

    --rlsj.
     
    rlsj, Sep 2, 2013
    #1
    1. Advertisements

  2. rlsj

    Elizabeth23

    Joined:
    Dec 10, 2012
    Messages:
    4,921
    Likes Received:
    347
    Location:
    Florida
    Elizabeth23, Sep 3, 2013
    #2
    1. Advertisements

  3. rlsj

    rlsj

    Joined:
    Aug 22, 2013
    Messages:
    5
    Likes Received:
    0
    Elizabeth23: Thanks for your response.

    I don't think the referenced article covers my problem, which has nothing to do with order of startup, as far as I can tell.

    I have a program that is normally run in a command-line window. I want it to be automatically invoked at system boot. It opens a socket and waits for a TCP connection, which means its process must continue to exist in the background. If I put its shortcut in the Windows startup folder, a command window flashes on the screen at reboot -- meaning the program has started but immediately terminates. How can I keep it running in the background so that its process name will appear in the Task Manager display?

    The referenced article seems to involve setting Registry keys. Where can I find information about their format, in particular how do I associate my program with any such key? And will a key that invokes the program at reboot keep it alive after it has proceeded to wait for a connection?

    --rlsj
     
    rlsj, Sep 3, 2013
    #3
  4. rlsj

    Elizabeth23

    Joined:
    Dec 10, 2012
    Messages:
    4,921
    Likes Received:
    347
    Location:
    Florida
    Can you tell me the name of your program?
     
    Elizabeth23, Sep 4, 2013
    #4
  5. rlsj

    Elizabeth23

    Joined:
    Dec 10, 2012
    Messages:
    4,921
    Likes Received:
    347
    Location:
    Florida
    http://www.dslreports.com/forum/r20558361-XP-Pro-Run-a-program-in-background

    this was one way, I have not used the start command but you may know how it works.

    http://trayit.en.softonic.com/

    above will create a system tray icon to keep it in the background, I have not used this program, but you can check it out, and read any reviews on it.

    http://www.perlmonks.org/index.pl?node_id=409996

    this may help also.

    http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds.mspx?mfr=true

    command line help
     
    Elizabeth23, Sep 4, 2013
    #5
  6. rlsj

    rlsj

    Joined:
    Aug 22, 2013
    Messages:
    5
    Likes Received:
    0
    Elizabeth23: Thanks for the pointer.

    Putting this bat file into the Windows startup folder works:

    d:
    cd \
    start /b c:\util\unison -socket 6996

    But it's messy. It leaves a command window open on the screen. Anything done to close that window terminates the background unison process. I can minimize it, but that still takes up a slot on the Start Bar, as well as requiring a redundant action at boot.

    I guess the short answer is that Windows-XP has nothing that quite matches the siimple Linux "&" command suffix. And yet many other programs seem able to run invisible processes in background after boot -- apparently just not those that must be started from the command-line.

    Will anyone dispute that?

    --rlsj
     
    rlsj, Sep 4, 2013
    #6
  7. rlsj

    Elizabeth23

    Joined:
    Dec 10, 2012
    Messages:
    4,921
    Likes Received:
    347
    Location:
    Florida
    Elizabeth23, Sep 4, 2013
    #7
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.