processedCmd = stripPrefixedPseudoCommand(cmd);
} else if (getWorkingDirectory() != null) {
logger.trace("Prefixing command line with cd statement because the current working directory was set");
logger.trace("Replacing: {}", cmd);
processedCmd = new CmdLine();
processedCmd.addArgument("cd");
processedCmd.addArgument(workingDirectory.getPath());
processedCmd.addRaw(os.getCommandSeparator());
for (CmdLineArgument a : cmd.getArguments()) {
processedCmd.add(a);
}