Welcome Guest, Not a member yet? Register   Sign In
exec
#1

[eluser]einsteinity[/eluser]
hi, i want to know how to execute command in command prompt with CI..

i have done it in php (not the CI) and here is the code.

Code:
<?
function callAV()
{
  exec('C:\"Program Files"\AVG\AVG2012\avgscanx.exe /scan="C: Users\\OWNER\\Documents\\belajar ngetik cepat.docx"', $output);
  foreach($output as $line)
  {
    $mac[] = $line;
  }
  return $mac;
}
$mac2 = callAV();
?>

<html>
<head><title>Check</title></head>
<body>
<p> Your files : <br />
&lt;?
foreach($mac2 as $coba)
{
  echo "$coba <br />";
}
?&gt;
&lt;/body&gt;
&lt;/html&gt;


the output is the scan result of the file, since this is only experimental code, i join the file path in the code which i want to execute, it means this one..
Code:
exec('C:\"Program Files"\AVG\AVG2012\avgscanx.exe /scan="C:\\Users\\OWNER\\Documents\\belajar ngetik cepat.docx"', $output);

really need some clues here..

PS: i only want to use this on localhost.
#2

[eluser]einsteinity[/eluser]
the slash in the file path is actually written once.. maybe the code tag changed it..




Theme © iAndrew 2016 - Forum software by © MyBB