Posted by Janwillem Borleffs on 10/24/05 00:10
Botan Guner wrote:
> Thanks, that solved my problem, but i can't keep thinking how would it
> be possible if the shell_exec is disabled from the ini file.
>
An alternative would be to use the COM extension (http://www.php.net/com).
Example:
<?php
$fso = new COM("Scripting.FileSystemObject")
or die("Could not create Scripting.FileSystemObject");
$dir = opendir('.');
while ($file = readdir($dir)) {
if ($file == '.' || $file == '..') {
continue;
}
if (is_dir($file)) {
$f = $fso->GetFolder(realpath($file));
} else {
$f = $fso->GetFile(realpath($file));
}
print $file;
if ($f->Attributes & 2) {
print ' [HIDDEN]';
}
print "\n";
}
closedir($dir);
?>
JW
Navigation:
[Reply to this message]
|