Exercising windows command as administrator from PHP

1

I have to run the following command as an administrator from PHP:

$salida="sintaxis\insertarlo.exe sintaxis\sumar.cpp";
$respuesta=array();
$estado;
exec($salida,$respuesta,$estado);

but apparently as it is an .exe you need the command to run as administrator, there is some option for the exec or another command to execute a command as administrator

    
asked by Yept 31.08.2018 в 00:28
source

1 answer

0

I found a way to execute the sudo command by downloading the sudo.exe from here link and adding it windows path variable and would run like this:

$salida="sudo sintaxis\insertarlo.exe sintaxis\sumar.cpp";
$respuesta=array();
$estado;
exec($salida,$respuesta,$estado);

If someone has a better answer, please tell me

    
answered by 31.08.2018 / 01:08
source