public static int[] getWindowsAttributes(String portName) throws IOException, SerialException {
        String[] command = { "cmd.exe", "/c", winCmd.replace("?", portName)};
        Process p = Runtime.getRuntime().exec(command);
        String output = new BufferedReader(new InputStreamReader(p.getInputStream())).readLine();
        LogIt.log("Found windows registry settings: " + output);
        String[] split = output.split("REG_SZ");
        if (split.length > 0) {
            int[] attr = {SerialPort.BAUDRATE_9600, 
                SerialPort.DATABITS_8, 
                SerialPort.STOPBITS_1, 
                SerialPort.PARITY_NONE,
                SerialPort.FLOWCONTROL_NONE};
            String settings = split[split.length -1];
            String[] _attr = settings.split(",");
            for (int i = 0; i < _attr.length; i++) {
                String val = _attr[i];
                switch (i) {
                    case 0: attr[0] = SerialUtilities.parseBaudRate(val); break;
                    case 1: attr[3] = SerialUtilities.parseParity(val); break;
                    case 2: attr[1] = SerialUtilities.parseDataBits(val); break;
                    case 3: attr[2] = SerialUtilities.parseStopBits(val); break;
                    case 4: attr[4] = SerialUtilities.parseFlowControl(val); break;
                    default: // Do nothing
                }
            }
            for (int i : attr) {
                if (i == -1) {
                    throw new SerialException("Cannot parse system provided "
                            + "serial attributes: " + output);
                }
            }
            return attr;
        }
        throw new SerialException("Cannot parse system provided "
                            + "serial attributes: " + output);
    }