Results 1 to 4 of 4
Thread: Help Me!
- 05-26-2010, 04:05 PM #1
Member
- Join Date
- May 2010
- Posts
- 17
- Rep Power
- 0
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...
- 05-26-2010, 04:23 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,423
- Blog Entries
- 7
- Rep Power
- 17
Read this article.
kind regards,
Jos
- 05-29-2010, 01:06 PM #3
Member
- Join Date
- May 2010
- Posts
- 17
- Rep Power
- 0
Hi Jos,
Thanks a lot for your Reply!!!:)
This article is helpful for me.
Thanks,
Ajitha.
- 05-29-2010, 01:31 PM #4
Member
- Join Date
- May 2010
- Location
- china
- Posts
- 7
- Rep Power
- 0


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks