Working with Unity Editor

I need help copying files that are inside Unity’s folder to where our executable is being created. I went online and found exactly what I was looking for but when I go ahead and implement it, the files are not being copied correctly. Here is what I have:

using UnityEngine;
using UnityEditor;
using System.Diagnostics;

public class UnityEditorClass {

    [MenuItem("MyTools/Windows Build With Postprocess")]
    public static void BuildGame()
        // Get filename.
        string path = EditorUtility.SaveFolderPanel("../Desktop/", "", ""); //The executable (for now) is created in the desktop

        // Copy a file from the project folder to the build folder, alongside the built game.
        FileUtil.CopyFileOrDirectory("C:/SchoolProjects/GSP2190/FirstGame", path + "vector2.dll");
        FileUtil.CopyFileOrDirectory("C:/SchoolProjects/GSP2190/FirstGame", path + "mathHelper.dll");

        // Run the game (Process class from System.Diagnostics).
        Process proc = new Process();
        proc.StartInfo.FileName = path + "Test.exe";

And yes, this script is stashed within the Editor folder.
My questions are:

  1. Is the file name path correct
  2. Am I copying the files correctly?
  3. How come my files are not being copied correctly?

Thank you so much in advance!

Pleas lookup EditorUtility.SaveFolderPanel - The first parameter is supposed to be the title of the dialog, not the folder.
If you’re not sure, try to Debug.Log() stuff out.

And only you can tell if the paths are right, but it looks like you are trying to copy the folder “JAI” onto a file… that doesn’t work.

You probably mean:
FileUtil.CopyFileOrDirectory(“C:/Projects/SBIR/sbir-phaseii/JAI/agility_input_win32.dll”, path + “agility_input_win32.dll”);

if the path includes a / at the end already.

Other than that, you need to know if these are the right files and if Test.exe really exists at the destination