rohansr002
Programmer
Hello friends i have written a Java code which access the CMD on WindowsXp through Java code, it works fine but This function is unstoppable i.e. you need to press "ctrl+C" key to terminate on cmd window, can anyone tell me how to terminate this function through Java. Please help..
The code written is as:
char ch='"';
String st="\\Memory\\Available bytes";
String str1="\\processor(_total)\\% processor time";
try {
Runtime.getRuntime().exec("C:\\WINDOWS\\System32\\CMD.exe /c typeperf "+ch+st+ch+" "+ch+str1+ch+" >> f:/mf.txt");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Need it urgently,
Thanks in advance...!!!
The code written is as:
char ch='"';
String st="\\Memory\\Available bytes";
String str1="\\processor(_total)\\% processor time";
try {
Runtime.getRuntime().exec("C:\\WINDOWS\\System32\\CMD.exe /c typeperf "+ch+st+ch+" "+ch+str1+ch+" >> f:/mf.txt");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Need it urgently,
Thanks in advance...!!!