Results 1 to 5 of 5

Thread: Null value

  1. #1
    Michael is offline Member
    Join Date
    Jun 2008
    Posts
    2
    Rep Power
    0

    Default Null value

    Hi everybody,
    I want to display the results of avgscan.exe c:\Foldername
    using java code
    The following is my code snippet. I got a value null
    Can anybody help me ?

    Runtime run = Runtime.getRuntime();
    Process pp=run.exec("C:\\Program Files\\Grisoft\\AVG Free\\avgscan c:\\VirusScan");
    BufferedReader in =new BufferedReader(new InputStreamReader(pp.getInputStream()));
    System.out.println(in.readLine());

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    Please don't ask your questions on existing thread, if it is not related to you. Next time start a new thread in such a case. Don't do it this time. I'll move this thread to correct place. :)

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

  4. #4
    ferranb is offline Member
    Join Date
    Jun 2008
    Posts
    22
    Rep Power
    0

    Default

    To give arguments you have to do it in the following way:

    String[] cmd = {
    "C:\\Program Files\\Grisoft\\AVG Free\\avgscan", // Command
    "c:\\VirusScan" // Argument
    };
    Process pp=run.exec(cmd);

    Try it,

    Ferran

  5. #5
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

Similar Threads

  1. Null pointer Exception
    By peiceonly in forum New To Java
    Replies: 8
    Last Post: 09-05-2010, 07:48 PM
  2. NULL Value Of parameters
    By riders in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 03-14-2008, 03:29 PM
  3. Img.getWidth(null); gives -1 why?
    By willemjav in forum New To Java
    Replies: 0
    Last Post: 02-15-2008, 03:06 PM
  4. What is NULL
    By bugger in forum New To Java
    Replies: 1
    Last Post: 01-09-2008, 05:55 PM
  5. parameters=null
    By mary in forum Java Servlet
    Replies: 1
    Last Post: 07-13-2007, 05:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •