Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2006

Tip: Looking for answers? Try searching our database.

Getting list of hosts

Thread view: 
Sard - 05 Jun 2006 21:17 GMT
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 - 09 Jun 2006 17:35 GMT
:-(
Luc The Perverse - 09 Jun 2006 18:32 GMT
> :-(

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

--
LTP

:)
Chris Uppal - 10 Jun 2006 13:15 GMT
> 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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.