--os.execute(" start c:\\Users\\Bailey\\source\\repos\\DCS-CMS-Editor-WinForm\\DCS-CMS-Editor-WinForm\\bin\\Debug\\WAIFU-DCS-Integrated-CMS-Editor.exe") 

--how to navigate to and launch a process located in Saved Games

local WAIFU = {} --makes space in a variable

--determines the location of the log file
--in this case, the file will be located at \Saved Games\DCS.openbeta\Logs\WAIFU.log
WAIFU.logFile = io.open(lfs.writedir()..[[Logs\WAIFU.log]], "w") 

--this function makes sure takes the log string and puts a newLine after it
function WAIFU.log(str)
    if WAIFU.logFile then
        WAIFU.logFile:write(str.."\n")
        WAIFU.logFile:flush()
    end
end

--WAIFU.log("Log Running...")This is to see that the log is running. Can be commented out.
--WAIFU.log("Tally1")I manually increase this by 1 every time I edit something to make sure that the log is still working

--WAIFU.log(lfs.currentdir())will return the full path of the DCS main folder. Eg. C:\BlahBlah\DCS World OpenBeta\
--WAIFU.log(lfs.writedir())will return the full path of the DCS Saved Games folder. Eg. C:\Users\ProfileName\Saved Games\DCS.openbeta\
 
WAIFU.log(lfs.writedir().."\Config\\options.lua")--writes the location of the options.lua in the log

local cmd = string.format("start " .. "\"\" \"" .. lfs.writedir() .. "\mods\\Services\\DCS-WAIFU\\bin\\DCS-WAIFU.exe\"")
--This one is kinda weird. We are putting a string into a variable
--'string.format' makes sure that what we write is what we want
--'start' is the command to start a process
--The random slashes and quotes are required, just because. If you miss them, 
--either the launch of the program will hang up on a space in the exe path, or DCS will
--hang up on waiting on the user to close the cmd.exe window on launch. 
--The contents of 'lfs.writedir()' is explained above. 
--The next part is where you want to go to execute what you want to execute.
--This explains the weird quotes https://superuser.com/questions/239565/can-i-use-the-start-command-with-spaces-in-the-path
 
WAIFU.log(cmd)--puts the above command into the log file for debugging. You sould be able to copy the 
--result from 'WAIFU.log(cmd)' into cmd.exe and it should launch your desired program.
os.execute(cmd)--executes the command
