static void writeCommands(List<String> cmdList, File cmdDir) throws IOException {
		File cmdTempFile = null;
		try {
			// Write command to temp file
			cmdTempFile = File.createTempFile("adm", ".tmp", cmdDir);
			FileUtils.writeLines(cmdTempFile, cmdList);

			// Rename temp file to *.cmd file
			String cmdFilename = cmdTempFile.getName();
			cmdFilename = cmdFilename.substring(0, cmdFilename.length() - 4) + COMMAND_FILE_EXT;
			File cmdFile = new File(cmdTempFile.getParentFile(), cmdFilename);
			if (!cmdTempFile.renameTo(cmdFile)) {
				throw new IOException("file error");
			}
			cmdTempFile = null;
		}
		finally {
			if (cmdTempFile != null) {
				cmdTempFile.delete();
			}
		}
	}
Store a list of command strings to a new command file.
@param cmdList list of command strings
@param cmdDir command file directory (must exist)
@throws IOException
Ghidra/Features/GhidraServer/src/main/java/ghidra/server/CommandProcessor.java