0
I am trying to change the current directory to another and thus manage to perform an action. The script below is working, but only in the root directory. I would like to open, for example the /temp
run and then quit again.
$comando="verifica_licenca.exe -v -f licencas$cnpj.dat";
//Executa o comando para verificar licença e armazena na variavel $line
$licencas = exec(escapeshellcmd($comando), $output);
reset($output);
while (list(,$line) = each($output)){
//Grava resultado da execução da execução no banco de dados
$stmt = mysqli_prepare($conexao, "INSERT INTO licenca (cnpj,dados, data) VALUES(?,?,?)");
mysqli_stmt_bind_param($stmt, 'sss', $cnpj, $line, $data);
mysqli_stmt_execute($stmt);
}
Thanks for your help.
You want to run the file
verifica_licenca.exe
across multiple directories? If so, use the absolute path, for example:C:\\Users\\user\\path\\to\\verifica_licenca.exe -v -f ...
– Valdeir Psr