Results 1 to 4 of 4

Thread: Help Me!

  1. #1
    Ajitha is offline Member
    Join Date
    May 2010
    Posts
    17
    Rep Power
    0

    Default Help Me!

    Hi all,

    I am new to java programming... I want to run chkdsk command using Java program.

    When i run the command, chkdsk /F/X or /I/X it ask me would you like to schedule this volume to be checked the next time the system restarts? (Y/N) option. If i click on Y,then it will check the volume when it restarts next time. But if I use this commnd in java code, it doesn't ask me the option, it starts to check the volume automatically. I used .exec() to execute the command.
    Below is my java code:

    try {
    Process p = Runtime.getRuntime().exec("cmd /c start chkdsk /I/X ");
    BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream()));
    String line = null;
    while ((line = reader.readLine()) != null) {
    System.out.println(line);
    }
    } catch (Exception e) {
    e.printStackTrace();
    }

    So can any one help me in this regard...

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,535
    Blog Entries
    7
    Rep Power
    20

    Default

    Read this article.

    kind regards,

    Jos

  3. #3
    Ajitha is offline Member
    Join Date
    May 2010
    Posts
    17
    Rep Power
    0

    Default

    Hi Jos,


    Thanks a lot for your Reply!!!:)

    This article is helpful for me.




    Thanks,
    Ajitha.

  4. #4
    wzq110120 is offline Member
    Join Date
    May 2010
    Location
    china
    Posts
    7
    Rep Power
    0

Posting Permissions

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