This method pauses the calling thread until the process finishes running and exits.
Returns the process exit code.
This method will close the handle to the finished process. You do not need to call Process:Close after calling this method.
Print("Launching process")
local proc = CreateProcess("C:/Windows/notepad.exe")
Print("Process running")
local exitcode = proc:Wait()
Print("Process ended (" .. tostring(exitcode) .. ")")