Can't run the native process.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dmjpro
    Top Contributor
    • Jan 2007
    • 2476

    Can't run the native process.

    I am running a command using Runtime.getRunt ime() on Windows.
    If i run 'ipconfig' it's running successfully but if i try to run 'ipconfig' with any arguments then it flashes an error ....
    CreateProcess error=2
    Why does this happen ..and how can i get rid out of it.

    Debasis Jana
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Is an IOException thrown by the ProcessBuilder (Runtime.exec)?

    kind regards,

    Jos

    Comment

    • dmjpro
      Top Contributor
      • Jan 2007
      • 2476

      #3
      Originally posted by JosAH
      Is an IOException thrown by the ProcessBuilder (Runtime.exec)?

      kind regards,

      Jos
      Yeah ...You are absolutely correct.
      But what i am doing ....
      [code=java]
      String command[] = {"ipconfig","al l"};
      Process p = Runtime.getRunt ime().exec(comm and);
      [/code]

      But it's getting hanged out ...never seems to be ended ... :-)
      What should i be doing?
      Please help.

      Debasis Jana.

      Comment

      • JosAH
        Recognized Expert MVP
        • Mar 2007
        • 11453

        #4
        Originally posted by dmjpro
        Yeah ...You are absolutely correct.
        But what i am doing ....
        [code=java]
        String command[] = {"ipconfig","al l"};
        Process p = Runtime.getRunt ime().exec(comm and);
        [/code]

        But it's getting hanged out ...never seems to be ended ... :-)
        What should i be doing?
        Please help.

        Debasis Jana.
        You should read 'consume' the output produced by the "ipconfig all" process.
        Remember: first read those fine API docs and only then start banging your
        keyboard.

        kind regards,

        Jos

        Comment

        Working...