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

H

Hoss Spence

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?
 
H

Hoss Spence

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.
 
R

Roedy Green

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.
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,434
Messages
2,571,685
Members
48,796
Latest member
Greg L.

Latest Threads

Top