-
자바 Check if some exe program is running on the windowsTech/SpringBoot 2015. 11. 6. 16:49반응형
자바로 윈도우즈에서 실행 중인 프로그램 리스트 가져오기
특정 프로그램에 대해 찾기
String line;
String pidInfo ="";
try {
Process p =Runtime.getRuntime().exec(System.getenv("windir") +"\\system32\\"+"tasklist.exe");
BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
while ((line = input.readLine()) != null) {
pidInfo+=line;
}
input.close();
if(pidInfo.contains("powershell.exe"))
{
System.out.println("find..");
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
반응형'Tech > SpringBoot' 카테고리의 다른 글
java static initial block- 자바 초기화 블럭 사용법 (0) 2016.02.24 spring boot jpa (mysql ) table 생성 에러해결 (0) 2015.12.26 Spring boot - Sigar 사용( 시스템 모니터링) (0) 2015.11.06 spring boot jpa(querydsl) (0) 2015.10.20 Spring data jpa cascade 관련 오류 (0) 2015.10.15