WinXP: nsiProcess brings up command prompt window - Mozilla

This is a discussion on WinXP: nsiProcess brings up command prompt window - Mozilla ; Hi everybody, The relevant part of the code is here: http://pastebin.mozilla.org/702853 In this basic example I'm just running `java -h` to test how nsiProcess works. The problem is that both .run() and .runAsync() bring up the command prompt window in ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: WinXP: nsiProcess brings up command prompt window

  1. WinXP: nsiProcess brings up command prompt window

    Hi everybody,

    The relevant part of the code is here: http://pastebin.mozilla.org/702853

    In this basic example I'm just running `java -h` to test how
    nsiProcess works. The problem is that both .run() and .runAsync()
    bring up the command prompt window in Windows (XP) which gets closed
    after the process is done. Is there a way to prevent that window from
    popping up?

    This doesn't happen on the Mac.

    Thanks,
    Stoyan

  2. Re: WinXP: nsiProcess brings up command prompt window

    On 14 Feb., 04:28, Stoyan wrote:
    > Hi everybody,
    >
    > The relevant part of the code is here:http://pastebin.mozilla.org/702853
    >
    > In this basic example I'm just running `java -h` to test how
    > nsiProcess works. The problem is that both .run() and .runAsync()
    > bring up the command prompt window in Windows (XP) which gets closed
    > after the process is done. Is there a way to prevent that window from
    > popping up?


    Quote from Java documentation:
    "The javaw command is identical to java, except that with javaw there
    is no associated console window. Use javaw when you don't want a
    command prompt window to appear. The javaw launcher will, however,
    display a dialog box with error information if a launch fails for some
    reason."

  3. Re: WinXP: nsiProcess brings up command prompt window

    Thanks Zorkzero, that's pretty cool and solves my problem with running
    java stuff from the command line!

    But what about other command-line programs that don't have a window-
    less option? I tried other programs such as optipng and the "ugly"
    command prompt window pops up.

    Thanks again,
    Stoyan



    On Feb 14, 1:13*am, Zorkzero wrote:
    > On 14 Feb., 04:28, Stoyan wrote:
    >
    > > Hi everybody,

    >
    > > The relevant part of the code is here:http://pastebin.mozilla.org/702853

    >
    > > In this basic example I'm just running `java -h` to test how
    > > nsiProcess works. The problem is that both .run() and .runAsync()
    > > bring up the command prompt window in Windows (XP) which gets closed
    > > after the process is done. Is there a way to prevent that window from
    > > popping up?

    >
    > Quote from Java documentation:
    > "The javaw command is identical to java, except that with javaw there
    > is no associated console window. Use javaw when you don't want a
    > command prompt window to appear. The javaw launcher will, however,
    > display a dialog box with error information if a launch fails for some
    > reason."



  4. Re: WinXP: nsiProcess brings up command prompt window

    Thank you guys, that was really helpful.

    I short-term quick-fix I found is to create a shortcut for the desired
    program and set the shortcut property to execute in a minimized
    window. Not as clean as no window at all, but not as unfriendly as a
    prompt window. When the program executes fast, it's almost
    unnoticeable - just a flash in the task bar.

    Thanks,
    Stoyan

    On Feb 15, 5:47*am, Benjamin Smedberg wrote:
    > On 2/14/10 3:53 PM, Stoyan wrote:
    >
    > > Thanks Zorkzero, that's pretty cool and solves my problem with running
    > > java stuff from the command line!

    >
    > > But what about other command-line programs that don't have a window-
    > > less option? I tried other programs such as optipng and the "ugly"
    > > command prompt window pops up.

    >
    > It really depends on how that program was compiled: if it was compiled with
    > the console subsystem linker flag, it will have a command prompt by default,
    > and if it was compiled with the windows subsystem linker flag, it will not
    > have a console by default. nsIProcess behaves very similarly to how a
    > shortcut file would behave.
    >
    > --BDS



+ Reply to Thread