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 + "'\""); }