PRIVATE void createSessionWC3270(String sessionParms){ ProcessBuilder p = NEW ProcessBuilder(); File tempFile = NEW File("C:\\Program Files\\wc3270\\"); System.OUT.println("1: " + tempFile.getAbsolutePath()); IF (tempFile.EXISTS()){ Thread openConsoleT = NEW Thread(NEW Runnable() { @Override PUBLIC void run() { try { System.OUT.println("powershell \"& '" + "start cmd.exe /C \"C:\\Program Files\\wc3270\\wc3270.exe\" " + sessionParms + "'\""); Process p = Runtime.getRuntime().exec("powershell \"& '" + "C:\\Program Files\\wc3270\\wc3270.exe " + sessionParms + "'\""); } catch (IOException e) { e.printStackTrace(); } } }); openConsoleT.START(); }ELSE{ tempFile = NEW File(("C:\\Program Files (x86)\\IBM\\wc3270\\")); IF (tempFile.EXISTS()){ Thread openConsoleT = NEW Thread(NEW Runnable() { @Override PUBLIC void run() { try { System.OUT.println("powershell \"& '" + "C:\\Program Files (x86)\\wc3270\\wc3270.exe " + sessionParms + "'\""); Process p = Runtime.getRuntime().exec("powershell \"& '" + "C:\\Program Files (x86)\\wc3270\\wc3270.exe " + sessionParms + "'\""); } catch (IOException e) { e.printStackTrace(); } } }); openConsoleT.START(); } } // Process p = Runtime.getRuntime().exec("powershell \"& '" + "wc3270.exe" + sessionParms + "'\""); }