ProcessBuilder.start and spaces invoking "net.exe" in Windows

Discussion in 'Java' started by Hoss Spence, Apr 2, 2008.

  1. Hoss Spence

    Hoss Spence Guest

    Hi,

    Having problem invoking this command.

    The code looks like the following

    ProcessBuilder pb = new ProcessBuilder(pExecutableArgs);
    pb.start();

    where pExecutableArgs is a List which contains
    [c:\WINDOWS\system32\net.exe, start, SQL Server (ABC)] e.g. a list
    with three elements.

    It appears to be choking on the spaces on "SQL Server (ABC"). I've
    tried quoting this but that doesn't work either. Any ideas?
     
    Hoss Spence, Apr 2, 2008
    #1
    1. Advertising

  2. Hoss Spence

    Hoss Spence Guest

    On Apr 2, 8:13 am, Hoss Spence <> wrote:
    > Hi,
    >
    > Having problem invoking this command.
    >
    > The code looks like the following
    >
    > ProcessBuilder pb = new ProcessBuilder(pExecutableArgs);
    > pb.start();
    >
    > where pExecutableArgs is a List which contains
    > [c:\WINDOWS\system32\net.exe, start, SQL Server (ABC)] e.g. a list
    > with three elements.
    >
    > It appears to be choking on the spaces on "SQL Server (ABC"). I've
    > tried quoting this but that doesn't work either. Any ideas?


    Oops... sorry for post. Quotes worked.
     
    Hoss Spence, Apr 2, 2008
    #2
    1. Advertising

  3. Hoss Spence

    Roedy Green Guest

    On Wed, 2 Apr 2008 07:13:06 -0700 (PDT), Hoss Spence
    <> wrote, quoted or indirectly quoted someone
    who said :

    >
    >It appears to be choking on the spaces on "SQL Server (ABC"). I've
    >tried quoting this but that doesn't work either. Any ideas?


    That is unbalanced. Please post your actual code. The devil is in the
    details.
    --

    Roedy Green Canadian Mind Products
    The Java Glossary
    http://mindprod.com
     
    Roedy Green, Apr 2, 2008
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. slightlykirix
    Replies:
    4
    Views:
    3,716
    Oliver Wong
    Sep 16, 2005
  2. Replies:
    2
    Views:
    7,593
  3. Knute Johnson
    Replies:
    2
    Views:
    723
    Mark Space
    Aug 15, 2008
  4. Muggle

    ProcessBuilder Firefox Linux

    Muggle, Sep 23, 2008, in forum: Java
    Replies:
    0
    Views:
    640
    Muggle
    Sep 23, 2008
  5. Replies:
    0
    Views:
    2,789
Loading...

Share This Page