String (@NotNull List<String> callArgs) { List<String> preparedCallArgs = CommandLineUtil.toCommandLine(callArgs); String firstArg = preparedCallArgs.remove(0); preparedCallArgs.add(0, CommandLineUtil.escapeParameterOnWindows(firstArg, false)); // for CMD we would like to add extra double quotes for the actual command in call // to mitigate possible JVM issue when argument contains spaces and the first word // starts with double quote and the last ends with double quote and JVM does not // wrap the argument with double quotes // Example: callArgs = ["\"C:\\New Folder\aa\"", "\"C:\\New Folder\aa\""] return '\"' + String.join(" ", preparedCallArgs) + "\""; }