Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Getting list of hosts

1 view
Skip to first unread message

Sard

unread,
Jun 5, 2006, 4:17:51 PM6/5/06
to
I'm using the following to execute "nbtscan 192.168.0.1-255"
(http://www.inetcat.org/software/nbtscan.html)

String line;
Process aProcess = Runtime.getRuntime().exec(cmdline);
BufferedReader input = new BufferedReader(new
InputStreamReader(
aProcess.getInputStream()));
while ((line = input.readLine()) != null)
{
output.add(line);
}
input.close();

So I can pass the output. Unfortunately I get

java.io.IOException: CreateProcess: nbtscan.exe 192.168.0.1-255
error=53
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(ProcessImpl.java:81)
at java.lang.ProcessImpl.start(ProcessImpl.java:30)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:451)
at java.lang.Runtime.exec(Runtime.java:591)
at java.lang.Runtime.exec(Runtime.java:429)
at java.lang.Runtime.exec(Runtime.java:326)

I am able to execute many other processes and capture their output but
not this one.

I'm using nbtscan as the InetAddress class is very unreliable as
reporting which ip addresses are reachable and it fails to
getHostName() a lot of the time too. Any help or a better was to get a
list of hosts would be great.

Sard

unread,
Jun 9, 2006, 12:35:16 PM6/9/06
to
:-(

Luc The Perverse

unread,
Jun 9, 2006, 1:32:14 PM6/9/06
to
"Sard" <Sarda...@gmail.com> wrote in message
news:1149870916....@i39g2000cwa.googlegroups.com...
> :-(
>

When you don't quote the message you are replying to people will not know
what you are talking about.

--
LTP

:)


Chris Uppal

unread,
Jun 10, 2006, 8:15:19 AM6/10/06
to
Sard wrote:

> I'm using the following to execute "nbtscan 192.168.0.1-255"
> (http://www.inetcat.org/software/nbtscan.html)

[...]


> I am able to execute many other processes and capture their output but
> not this one.

Works OK for me, either using my own test code or yours. Perhaps there's
something wrong with the executable, or the cygwin.dll which it needs. You
could try re-"installing" it.

Alternatively, maybe something it is trying to do is interacting badly with a
virus checker (or similar) on your system.

Incidentally, I would be a bit reluctant to depend on external executables that
use Cygwin. It seems to work OK in this case, but you /might/ find it
worthwhile porting nbtscan to MSVC, or MinGW, to avoid potential problems.

-- chris

0 new messages