2013. 6. 27.

Running multiple batch command at the same time by dos command.

Each batch file runs without waiting for ending previous batch commands.

(sample1)
Multi_run.bat

   start cmd.exe /C  bat_comm1.bat 
   start cmd.exe /C  bat_comm2.bat 
   start cmd.exe /C  bat_comm3.bat 

2013. 6. 14.

Kill specified process list

kill `ps aux | grep keyword| grep -v grep | awk '{print $2}'`

# check keyword and kill processes by pid from awk

2013. 6. 11.

When creating process in java , If it does not worked.

check 1:
 - close all stream

    ProcessBuilder pb = new ProcessBuilder("app.exe");
    Process prs = pb.start();

   prs.getErrorStream.close();
   prs.getInputStream.close();
   prs.getOutputStream.close();
 

check2 :
  - check working directory or path
  - some application checks files in current directory.
  - parent working directory is different from sub application.

 
    ProcessBuilder pb = new ProcessBuilder("app.exe");
 
    pb.directory("location of app.exe");

    Process prs = pb.start();
    prs.getErrorStream.close();
   prs.getInputStream.close();
   prs.getOutputStream.close();