@Override
	protected void run() throws Exception {

		// Error if not running on Windows
		if (Platform.CURRENT_PLATFORM.getOperatingSystem() != OperatingSystem.WINDOWS) {
			popup("Aborting: This script is for use on Windows only.");
			return;
		}

		// Get appropriate pdb.exe file
		String pdbExeLocation = Application.getOSFile("pdb.exe").getAbsolutePath();

		List<String> choices = Arrays.asList("single file", "directory of files");
		String fileOrDir = askChoice("PDB file or directory",
			"Would you like to operate on a single " + ".pdb file or a directory of .pdb files?",
			choices, choices.get(1));

		File pdbParentDir;
		String pdbName;

		int filesCreated = 0;

		try {
			if (fileOrDir.equals(choices.get(0))) {
				File pdbFile = askFile("Choose a PDB file", "OK");

				if (!pdbFile.exists()) {
					popup(pdbFile.getAbsolutePath() + " is not a valid file.");
					return;
				}

				if (!pdbFile.getName().endsWith(".pdb")) {
					popup("Aborting: Expected input file to have extension of type .pdb (got '" +
						pdbFile.getName() + "').");
					return;
				}

				pdbParentDir = pdbFile.getParentFile();
				pdbName = pdbFile.getName();

				println("Processing: " + pdbFile.getAbsolutePath());

				runPdbExe(pdbExeLocation, pdbParentDir, pdbName, pdbFile.getAbsolutePath());

				filesCreated = 1;
			}
			else {
				// Do recursive processing
				File pdbDir = askDirectory(
					"Choose PDB root folder (performs recursive search for .pdb files)", "OK");

				// Get list of files to process
				List<File> pdbFiles = new ArrayList<>();
				getPDBFiles(pdbDir, pdbFiles);

				int createdFilesCounter = 0;

				for (File childPDBFile : pdbFiles) {
					pdbParentDir = childPDBFile.getParentFile();
					pdbName = childPDBFile.getName();

					String currentFilePath = childPDBFile.getAbsolutePath();
					println("Processing: " + currentFilePath);

					runPdbExe(pdbExeLocation, pdbParentDir, pdbName, currentFilePath);

					createdFilesCounter++;

					if (monitor.isCancelled()) {
						break;
					}
				}

				filesCreated = createdFilesCounter;
			}
		}
		catch (IOException ioe) {
			popup(ioe.getMessage());
		}

		if (filesCreated > 0) {
			popup("Created " + filesCreated + " .pdb.xml file(s).");
		}
	}
Asks user for a single .pdb file or a directory that contains .pdb files (search for
files is recursive).

Parses each .pdb file and creates a corresponding .pdb.xml file in the same location as
the original file. The .pdb.xml files can be used to apply debugging information when
running Ghidra on non-Windows systems.

This script can only be run on Windows and using the headed (GUI) version of Ghidra.
Ghidra/Features/Base/ghidra_scripts/CreatePdbXmlFilesScript.java