Skip to content

Instantly share code, notes, and snippets.

@dseeni
Forked from talisker77/doStartProcess.lua
Created June 28, 2023 21:34
Show Gist options
  • Select an option

  • Save dseeni/7fbe7628cb1a87a09adc6c82794d527c to your computer and use it in GitHub Desktop.

Select an option

Save dseeni/7fbe7628cb1a87a09adc6c82794d527c to your computer and use it in GitHub Desktop.
start a process in powershell using lua script
function doStartProcess(programWithParams)
local psCmd = '"powershell.exe -Command "Start-Process cmd " -ArgumentList "/c", "\'' .. programWithParams .. '\'" -Verb RunAs -Wait"'
--print (psCmd)
os.execute(psCmd)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment