String exe(String cmd){
        
        Process proc;
        BufferedReader stdInput, stdError;
        // return string: message 
        String msg = "Command: \"" + cmd + "\" excuted results:" + newLine;
        // temp string: str
        String str;
        
        try{
            proc = Runtime.getRuntime().exec(cmd, null, dir);
            
            stdInput = new BufferedReader
                    (new InputStreamReader(proc.getInputStream()));
            stdError = new BufferedReader
                    (new InputStreamReader(proc.getErrorStream()));
            
            while((str = stdInput.readLine()) != null){
                msg += str + newLine;
            }
            
            if ((str = stdError.readLine()) != null){
                msg += str + newLine;
                while((str = stdError.readLine()) != null){
                    msg += str + newLine;
                }
                
                proc.destroy();
                
            }   
        } catch (Exception e){
            msg += e.toString() + newLine;
        }
         
        
        // command executing results
        return msg;
    }